swis/moonphase-bundle

This Bundle integrates some moon phase calculation stuff into a Symfony2 project.

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master 2013-03-30 09:14 UTC

This package is not auto-updated.

Last update: 2024-05-05 00:59:29 UTC


README

Build Status

This Bundle is designed to add some moon phase calculation stuff to your Symfony2 project.

Installation

Installation by Composer

If you use composer, add the bundle as dependency to the composer.json of your application

for Symfony 2.x

"require": {
    ...
    "swis/moonphase-bundle": "dev-master"
    ...
},

Installation via git submodule

    git submodule add git://github.com/swis/MoonPhaseBundle.git vendor/bundles/Swis/Bundle/MoonPhaseBundle

Instantiate Bundle in your kernel init file

// app/AppKernel.php
<?php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Swis\Bundle\MoonPhaseBundle\SwisMoonPhaseBundleBundle(),
        );
    }

Base configuration

Actually, there is no configuration needed.

Usage

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();

        // ...
    }
}