blanchonvincent/symfony-bridge-module
最新稳定版本:0.3.8
Composer 安装命令:
composer require blanchonvincent/symfony-bridge-module
包简介
A bridge to integrate Symfony component
README 文档
README
Introduction
This repository will provide bridge to integrate Symfony component.
Console
To integrate the Symfony2 console component, that's pretty easy :
- Add configuration to your
application.config.php:
return array( 'modules' => array( // your usual config there ), 'module_listener_options' => array( // your usual config there ), 'service_manager' => array( 'invokables' => array( 'SymfonyBridgeModule\Console\CommandsManager' => 'SymfonyBridgeModule\Console\CommandsManager', ), ), 'service_listener_options' => array( array( 'service_manager' => 'SymfonyBridgeModule\Console\CommandsManager', 'config_key' => 'symfony_commands', 'interface' => 'SymfonyBridgeModule\ModuleManager\Feature\ConsoleCommandsProviderInterface', 'method' => 'getConsoleCommands', ), ), );
Now, just implements the SymfonyBridgeModule\ModuleManager\Feature\ConsoleCommandsProviderInterface interface in the modules
to provide commands :
class Module implements ConsoleCommandsProviderInterface { public function getConsoleCommands() { return array( 'invokables' => array( 'foo' => 'SymfonyBridgeModuleTest\Fixtures\FooModule\Command\FooCommand', ), ); } }
Then copy the console console.php.dist and update the file from your project settings.
You can try to run the console.php as an example :
php console.php
Available commands:
foo
help Displays help for a command
list Lists commands
The foo command will print Hello world!.
Container Builder
This module provide a gateway to integrate the container builder from Symfony2.
Router
Once you're using the container builder, the route listener will be automatically added. You have just to provide your
routing.yml file inside the config folder.
统计信息
- 总下载量: 1.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-25