You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module presents a __Controller Plugin__ called `tacticianCommandBus()` for easy use of dispatching commands. If no command object is passed to it, the CommandBus object will be returned. If you pass the command however, it will be passed over to the CommandBus and handled, and the output from the handler will be returned.
27
25
@@ -85,7 +83,7 @@ final class UserLoginHandler
85
83
86
84
You can inject the `CommandBus` into yout service layer through a factory by simply requesting the `League\Tactician\CommandBus::class` from the __Container__.
87
85
88
-
###Configuring
86
+
## Configuring
89
87
90
88
The module ships with a `ZendLocator` and a `CommandHandlerMiddleware` and a `HandlerInflector` configured as default. If you wish to override the default locator or default command bus implementations, then simply use the `tactician` key in the merged config.
91
89
@@ -117,7 +115,7 @@ To add custom middleware to the middleware stack, add it to the `middleware` arr
117
115
],
118
116
```
119
117
120
-
###Basic usage
118
+
## Basic usage
121
119
122
120
Basicly, all you probably will want to do, is to define the `handler-map` array in your module's configuration. For example:
123
121
@@ -134,9 +132,9 @@ Basicly, all you probably will want to do, is to define the `handler-map` array
134
132
];
135
133
```
136
134
137
-
###Plugins
135
+
## Plugins
138
136
139
-
####LockingMiddleware
137
+
### LockingMiddleware
140
138
141
139
The [LockingMiddleware](http://tactician.thephpleague.com/plugins/locking-middleware/) can now be used out of the box.
142
140
Simply add the `League\Tactician\Plugins\LockingMiddleware` FQCN to the TacticianModule's middleware configuration with
@@ -155,7 +153,7 @@ appropriate priority. You probably want to execute it before the `CommandHandler
155
153
];
156
154
```
157
155
158
-
####TransactionMiddleware
156
+
### TransactionMiddleware
159
157
160
158
The [TransactionMiddleware](http://tactician.thephpleague.com/plugins/doctrine/) can now be used out of the box.
161
159
Simply add the `League\Tactician\Doctrine\ORM\TransactionMiddleware` FQCN to the TacticianModule's middleware configuration with
@@ -174,9 +172,9 @@ appropriate priority. You probably want to execute it before the `CommandHandler
174
172
];
175
173
```
176
174
177
-
###Changing the Handler Locator
175
+
## Changing the Handler Locator
178
176
179
-
####ClassnameZendLocator
177
+
### ClassnameZendLocator
180
178
181
179
This locator simply appends the word `Handler` to the command's FQCN so you don't have to define any handler map. For example, if you request command `App\Commands\LoginCommand`, locator will try to get `App\Command\LoginCommandHandler` from the Service Manager.
0 commit comments