六路径/icalendar-bundle

安装: 296

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 2

开放问题: 0

类型:symfony-bundle

0.0.5 2020-03-04 13:51 UTC

This package is auto-updated.

Last update: 2024-09-04 23:54:56 UTC


README

安装

手动安装

将此内容添加到您的 composer.json 中

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

自动化安装

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

app/AppKernel.php 中激活此包

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

使用方法

建议将此服务注入到监听器或其他可能需要消费它的服务中,而不是使用 $this->get('...'); 来代替控制器;然而,此选项仍然可用

作为控制器的一部分

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

作为控制台命令的一部分

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');
    }
}