This Bundle is designed to add some moon phase calculation stuff to your Symfony2 project.
If you use composer, add the bundle as dependency to the composer.json of your application
"require": {
...
"swis/moonphase-bundle": "dev-master"
...
},
git submodule add git://github.com/swis/MoonPhaseBundle.git vendor/bundles/Swis/Bundle/MoonPhaseBundle
// app/AppKernel.php
<?php
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Swis\Bundle\MoonPhaseBundle\SwisMoonPhaseBundleBundle(),
);
}
Actually, there is no configuration needed.
In your controller, use
// src/Acme/HelloBundle/Controller/HelloController.php
namespace Acme\HelloBundle\Controller;
class HelloController
{
public function indexAction($name)
{
// ...
$lastNewMoonAsDateTime = $this->get('swis_moon_calculator')->getLastNewMoon();
// ...
}
}