KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
yii2-tactician
★ 14
Open GitHub ↗
Tactician adapter for Yii2
Download README (.md)
Explore Similar Repositories
LintCode
:
My solution to LintCode problems.
clusterous
:
Cluster computing tool to deploy Docker containers on AWS
BlackfireMagentoVagrant
:
No description available.
wonderbuild
:
Wonderbuild is an extremely fast, extensible build tool
ObservableScrollers
:
Easy to use observable scroller.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
yii2-tactician
?
Download (.md)
Yii2 Tactician ============== [Tactician](https://github.com/thephpleague/tactician) is a simple, flexible package allows you to easy implement Command Bus pattern in your application. This package provide it's very basic integration with Yii2 Installation ------------ The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Either run ``` php composer.phar require trntv/yii2-tactician ``` or add ``` "trntv/yii2-tactician": "*" ``` to the require section of your `composer.json` file. Usage ----- Somewhere in your config: ```php 'components' => [ ... 'commandBus' => [ 'class' => '\trntv\tactician\Tactician', 'commandNameExtractor' => '\League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor' 'methodNameInflector' => '\League\Tactician\Handler\MethodNameInflector\HandleInflector' 'commandToHandlerMap' => [ 'app\commands\command\SendEmailCommand' => 'app\commands\handler\SendEmailHandler' ], 'middlewares' => [ ... ] ] ... ] ``` Somewhere in your app: ```php Yii::$app->commandBus->handle(new SendEmailCommand([ 'from' => 'email@example.org', 'to' => 'user@example.org', 'body' => '...' ])) Yii::$app->commandBus->handleMultiply([ new SendEmailCommand([ 'from' => 'email@example.org', 'to' => 'user@example.org', 'body' => '...' ]), new SomeOtherCommand([ ... ]) ]) ```