PHP code example of cherif / yii2-tactician

1. Go to this page and download the library: Download cherif/yii2-tactician library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cherif / yii2-tactician example snippets


...
'components'=>[
...
				'commandBus'=> [
					'class'=>'cherif\tactician\Tactician',
					'inflector' => 'League\Tactician\Handler\MethodNameInflector\HandleClassNameInflector',
					'extractor' => 'League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor',
					'commandHandlerMap'=> [
						'cherif\tactician\tests\fixtures\commands\CompleteTaskCommand' => 'cherif\tactician\tests\fixtures\handlers\CompleteTaskCommandHandler',
					]
				]
			]

	Yii:$app->commandBus->handle(new CompleteTaskCommand)

$middleware = new MiddlewareClass();
$command = new MyCommand();

Yii::$app->commandBus->registerMiddleware($middleware);

Yii::$app->commandBus->handle($command);

php composer.phar