six-paths/icalendar-bundle

0.0.5 2020-03-04 13:51 UTC

This package is auto-updated.

Last update: 2024-04-04 22:49:28 UTC


README

Installation

Manual Installation

Add this to your composer.json

"require": {
    "six-paths/icalendar-bundle": "dev-master"
}

Automated Installation

composer require six-paths/icalendar-bundle@dev-master

Activate the bundle in app/AppKernel.php

$bundles = array(
    // ...
    new Sixpaths\ICalendarBundle\SixpathsICalendarBundle(),
);

Usage

It is advised to inject this service in to listeners or other services that may need to consume it rather than using $this->get('...'); instead of a controller; however, that option is still available

As part of a controller

class SomeController extends Controller
{
    public function someAction(/* ...$arguments */)
    {
        $icalendar = $this->get('sixpaths.icalendar');
    }
}

As part of a console command

class SomeCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this->setName('some:command')
            ->setDescription('A command');
    }

    protected function execute(InterInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        $icalendar = $container->get('sixpaths.icalendar');
    }
}