2017 © Pedro Peláez
 

yii2-extension yii2-tactician

A simple, flexible command bus. This package provide it's integration with Yii2

image

trntv/yii2-tactician

A simple, flexible command bus. This package provide it's integration with Yii2

  • Saturday, February 3, 2018
  • by trntv
  • Repository
  • 2 Watchers
  • 14 Stars
  • 8,553 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Yii2 Tactician

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, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require trntv/yii2-tactician

or add, (*4)

"trntv/yii2-tactician": "*"

to the require section of your composer.json file., (*5)

Usage

Somewhere in your config:, (*6)

'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:, (*7)

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([
        ...
    ])
])

The Versions

03/02 2018

dev-master

9999999-dev

A simple, flexible command bus. This package provide it's integration with Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

03/02 2018

1.0.1

1.0.1.0

A simple, flexible command bus. This package provide it's integration with Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

09/02 2016

1.0.0

1.0.0.0

A simple, flexible command bus. This package provide it's integration with Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2

16/08 2015

0.1.1

0.1.1.0

A simple, flexible command bus. This package provide it's integration with Yii2

  Sources   Download

GPL-3.0

The Requires

 

extension yii2

02/06 2015

0.1.0

0.1.0.0

A simple, flexible command bus. This package provide it's integration with Yii2

  Sources   Download

GPL-3.0

The Requires

 

extension yii2