六路径 / icalendar-bundle
0.0.5
2020-03-04 13:51 UTC
Requires
- php: >=7.1
- liliumdev/icalendar: 0.1.2
Requires (Dev)
- phpunit/phpunit: ~5
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'); } }