Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 1801f70

Browse files
committed
Merge pull request #68 from froschdesign/hotfix/docs/60
[Docs] Fixes bullet lists - See #60
2 parents 09d945b + 525c1f1 commit 1801f70

8 files changed

+251
-268
lines changed

doc/book/zend.mvc.controllers.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ often difficult to achieve cleanly in abstract, general systems.
104104
Within your controllers, you'll often find yourself repeating tasks from one controller to another.
105105
Some common examples:
106106

107-
- Generating URLs
108-
- Redirecting
109-
- Setting and retrieving flash messages (self-expiring session messages)
110-
- Invoking and dispatching additional controllers
107+
* Generating URLs
108+
* Redirecting
109+
* Setting and retrieving flash messages (self-expiring session messages)
110+
* Invoking and dispatching additional controllers
111111

112112
To facilitate these actions while also making them available to alternate controller
113113
implementations, we've created a `PluginManager` implementation for the controller layer,
@@ -149,13 +149,13 @@ As such, we've developed two abstract, base controllers you can extend to get st
149149
The first is `Zend\Mvc\Controller\AbstractActionController`. This controller implements each of the
150150
above interfaces, and uses the following assumptions:
151151

152-
- An "action" parameter is expected in the `RouteMatch` object composed in the attached `MvcEvent`.
152+
* An "action" parameter is expected in the `RouteMatch` object composed in the attached `MvcEvent`.
153153
If none is found, a `notFoundAction()` is invoked.
154-
- The "action" parameter is converted to a camelCased format and appended with the word "Action" to
154+
* The "action" parameter is converted to a camelCased format and appended with the word "Action" to
155155
create a method name. As examples: "foo" maps to "fooAction", "foo-bar" or "foo.bar" or "foo\_bar"
156156
to "fooBarAction". The controller then checks to see if that method exists. If not, the
157157
`notFoundAction()` method is invoked; otherwise, the discovered method is called.
158-
- The results of executing the given action method are injected into the `MvcEvent`'s "result"
158+
* The results of executing the given action method are injected into the `MvcEvent`'s "result"
159159
property (via `setResult()`, and accessible via `getResult()`).
160160

161161
Essentially, a route mapping to an `AbstractActionController` needs to return both "controller" and
@@ -186,16 +186,16 @@ class BarController extends AbstractActionController
186186

187187
`AbstractActionController` implements each of the following interfaces:
188188

189-
- `Zend\Stdlib\DispatchableInterface`
190-
- `Zend\Mvc\InjectApplicationEventInterface`
191-
- `Zend\ServiceManager\ServiceLocatorAwareInterface`
192-
- `Zend\EventManager\EventManagerAwareInterface`
189+
* `Zend\Stdlib\DispatchableInterface`
190+
* `Zend\Mvc\InjectApplicationEventInterface`
191+
* `Zend\ServiceManager\ServiceLocatorAwareInterface`
192+
* `Zend\EventManager\EventManagerAwareInterface`
193193

194194
The composed `EventManager` will be configured to listen on the following contexts:
195195

196-
- `Zend\Stdlib\DispatchableInterface`
197-
- `Zend\Mvc\Controller\AbstractActionController`
198-
- `Zend\Mvc\Controller\AbstractController`
196+
* `Zend\Stdlib\DispatchableInterface`
197+
* `Zend\Mvc\Controller\AbstractActionController`
198+
* `Zend\Mvc\Controller\AbstractController`
199199

200200
Additionally, if you extend the class, it will listen on the extending class's name.
201201

@@ -205,18 +205,18 @@ The second abstract controller ZF2 provides is `Zend\Mvc\Controller\AbstractRest
205205
controller provides a native RESTful implementation that simply maps HTTP request methods to
206206
controller methods, using the following matrix:
207207

208-
- **GET** maps to either `get()` or `getList()`, depending on whether or not an "id" parameter is
208+
* **GET** maps to either `get()` or `getList()`, depending on whether or not an "id" parameter is
209209
found in the route matches. If one is, it is passed as an argument to `get()`; if not, `getList()`
210210
is invoked. In the former case, you should provide a representation of the given entity with that
211211
identification; in the latter, you should provide a list of entities.
212-
- **POST** maps to `create()`. That method expects a `$data` argument, usually the `$_POST`
212+
* **POST** maps to `create()`. That method expects a `$data` argument, usually the `$_POST`
213213
superglobal array. The data should be used to create a new entity, and the response should typically
214214
be an HTTP 201 response with the Location header indicating the URI of the newly created entity and
215215
the response body providing the representation.
216-
- **PUT** maps to `update()`, and requires that an "id" parameter exists in the route matches; that
216+
* **PUT** maps to `update()`, and requires that an "id" parameter exists in the route matches; that
217217
value is passed as an argument to the method. It should attempt to update the given entity, and, if
218218
successful, return either a 200 or 202 response status, as well as the representation of the entity.
219-
- **DELETE** maps to `delete()`, and requires that an "id" parameter exists in the route matches;
219+
* **DELETE** maps to `delete()`, and requires that an "id" parameter exists in the route matches;
220220
that value is passed as an argument to the method. It should attempt to delete the given entity,
221221
and, if successful, return either a 200 or 204 response status.
222222

@@ -229,15 +229,15 @@ used to submit to the various RESTful methods, or to add RPC methods to your RES
229229

230230
`AbstractRestfulController` implements each of the following interfaces:
231231

232-
- `Zend\Stdlib\DispatchableInterface`
233-
- `Zend\Mvc\InjectApplicationEventInterface`
234-
- `Zend\ServiceManager\ServiceLocatorAwareInterface`
235-
- `Zend\EventManager\EventManagerAwareInterface`
232+
* `Zend\Stdlib\DispatchableInterface`
233+
* `Zend\Mvc\InjectApplicationEventInterface`
234+
* `Zend\ServiceManager\ServiceLocatorAwareInterface`
235+
* `Zend\EventManager\EventManagerAwareInterface`
236236

237237
The composed `EventManager` will be configured to listen on the following contexts:
238238

239-
- `Zend\Stdlib\DispatchableInterface`
240-
- `Zend\Mvc\Controller\AbstractRestfulController`
241-
- `Zend\Mvc\Controller\AbstractController`
239+
* `Zend\Stdlib\DispatchableInterface`
240+
* `Zend\Mvc\Controller\AbstractRestfulController`
241+
* `Zend\Mvc\Controller\AbstractController`
242242

243243
Additionally, if you extend the class, it will listen on the extending class's name.

doc/book/zend.mvc.intro.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ focusing on performance and flexibility.
55

66
The MVC layer is built on top of the following components:
77

8-
- `Zend\ServiceManager` - Zend Framework provides a set of default service definitions set up at
8+
* `Zend\ServiceManager` - Zend Framework provides a set of default service definitions set up at
99
`Zend\Mvc\Service`. The `ServiceManager` creates and configures your application instance and
1010
workflow.
11-
- `Zend\EventManager` - The MVC is event driven. This component is used everywhere from initial
11+
* `Zend\EventManager` - The MVC is event driven. This component is used everywhere from initial
1212
bootstrapping of the application, through returning response and request calls, to setting and
1313
retrieving routes and matched routes, as well as render views.
14-
- `Zend\Http` - specifically the request and response objects, used within:
15-
- `Zend\Stdlib\DispatchableInterface`. All "controllers" are simply dispatchable objects.
14+
* `Zend\Http` - specifically the request and response objects, used within:
15+
* `Zend\Stdlib\DispatchableInterface`. All "controllers" are simply dispatchable objects.
1616

1717
Within the MVC layer, several sub-components are exposed:
1818

19-
- `Zend\Mvc\Router` contains classes pertaining to routing a request. In other words, it matches the
19+
* `Zend\Mvc\Router` contains classes pertaining to routing a request. In other words, it matches the
2020
request to its respective controller (or dispatchable).
21-
- `Zend\Http\PhpEnvironment` provides a set of decorators for the HTTP `Request` and `Response`
21+
* `Zend\Http\PhpEnvironment` provides a set of decorators for the HTTP `Request` and `Response`
2222
objects that ensure the request is injected with the current environment (including query
2323
parameters, POST parameters, HTTP headers, etc.)
24-
- `Zend\Mvc\Controller`, a set of abstract "controller" classes with basic responsibilities such as
24+
* `Zend\Mvc\Controller`, a set of abstract "controller" classes with basic responsibilities such as
2525
event wiring, action dispatching, etc.
26-
- `Zend\Mvc\Service` provides a set of `ServiceManager` factories and definitions for the default
26+
* `Zend\Mvc\Service` provides a set of `ServiceManager` factories and definitions for the default
2727
application workflow.
28-
- `Zend\Mvc\View` provides default wiring for renderer selection, view script resolution, helper
28+
* `Zend\Mvc\View` provides default wiring for renderer selection, view script resolution, helper
2929
registration, and more; additionally, it provides a number of listeners that tie into the MVC
3030
workflow, providing features such as automated template name resolution, automated view model
3131
creation and injection, and more.
@@ -172,15 +172,15 @@ The `view` directory contains view scripts related to your controllers.
172172

173173
The `Application` has six basic dependencies.
174174

175-
- **configuration**, usually an array or object implementing `Traversable`.
176-
- **ServiceManager** instance.
177-
- **EventManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
175+
* **configuration**, usually an array or object implementing `Traversable`.
176+
* **ServiceManager** instance.
177+
* **EventManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
178178
name "EventManager".
179-
- **ModuleManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
179+
* **ModuleManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
180180
name "ModuleManager".
181-
- **Request** instance, which, by default, is pulled from the `ServiceManager`, by the service name
181+
* **Request** instance, which, by default, is pulled from the `ServiceManager`, by the service name
182182
"Request".
183-
- **Response** instance, which, by default, is pulled from the `ServiceManager`, by the service name
183+
* **Response** instance, which, by default, is pulled from the `ServiceManager`, by the service name
184184
"Response".
185185

186186
These may be satisfied at instantiation:
@@ -206,13 +206,13 @@ $application = new Application($config, $serviceManager);
206206
Once you've done this, there are two additional actions you can take. The first is to "bootstrap"
207207
the application. In the default implementation, this does the following:
208208

209-
- Attaches the default route listener (`Zend\Mvc\RouteListener`).
210-
- Attaches the default dispatch listener (`Zend\Mvc\DispatchListener`).
211-
- Attaches the `ViewManager` listener (`Zend\Mvc\View\ViewManager`).
212-
- Creates the `MvcEvent`, and injects it with the application, request, and response; it also
209+
* Attaches the default route listener (`Zend\Mvc\RouteListener`).
210+
* Attaches the default dispatch listener (`Zend\Mvc\DispatchListener`).
211+
* Attaches the `ViewManager` listener (`Zend\Mvc\View\ViewManager`).
212+
* Creates the `MvcEvent`, and injects it with the application, request, and response; it also
213213
retrieves the router (`Zend\Mvc\Router\Http\TreeRouteStack`) at this time and attaches it to the
214214
event.
215-
- Triggers the "bootstrap" event.
215+
* Triggers the "bootstrap" event.
216216

217217
If you do not want these actions, or want to provide alternatives, you can do so by extending the
218218
`Application` class and/or simply coding what actions you want to occur.
@@ -270,22 +270,21 @@ $configuration = include 'config/application.config.php';
270270
Application::init($configuration)->run();
271271
```
272272

273-
The `init()` method will basically do the following:
274-
- Grabs the application configuration and pulls from the `service_manager` key, creating a
275-
`ServiceManager`
276-
instance with it and with the default services shipped with `Zend\Mvc`;
273+
The `init()` method will basically do the following:
277274

278-
- Create a service named `ApplicationConfig` with the application configuration array;
279-
- Grabs the `ModuleManager` service and load the modules;
280-
- `bootstrap()`s the `Application` and returns its instance;
275+
* Grabs the application configuration and pulls from the `service_manager` key, creating a
276+
`ServiceManager` instance with it and with the default services shipped with `Zend\Mvc`;
277+
* Create a service named `ApplicationConfig` with the application configuration array;
278+
* Grabs the `ModuleManager` service and load the modules;
279+
* `bootstrap()`s the `Application` and returns its instance;
281280

282281
> ### Note
283282
If you use the `init()` method, you cannot specify a service with the name of 'ApplicationConfig' in
284283
your service manager config. This name is reserved to hold the array from application.config.php.
285284
The following services can only be overridden from application.config.php:
286-
- `ModuleManager`
287-
- `SharedEventManager`
288-
- `EventManager` & `Zend\EventManager\EventManagerInterface`
285+
* `ModuleManager`
286+
* `SharedEventManager`
287+
* `EventManager` & `Zend\EventManager\EventManagerInterface`
289288
All other services are configured after module loading, thus can be overridden by modules.
290289

291290
You'll note that you have a great amount of control over the workflow. Using the `ServiceManager`,

doc/book/zend.mvc.mvc-event.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,37 @@ Additionally, if your controllers implement the `Zend\Mvc\InjectApplicationEvent
88

99
The `MvcEvent` adds accessors and mutators for the following:
1010

11-
- `Application` object.
12-
- `Request` object.
13-
- `Response` object.
14-
- `Router` object.
15-
- `RouteMatch` object.
16-
- Result - usually the result of dispatching a controller.
17-
- `ViewModel` object, typically representing the layout view model.
11+
* `Application` object.
12+
* `Request` object.
13+
* `Response` object.
14+
* `Router` object.
15+
* `RouteMatch` object.
16+
* Result - usually the result of dispatching a controller.
17+
* `ViewModel` object, typically representing the layout view model.
1818

1919
The methods it defines are:
2020

21-
- `setApplication($application)`
22-
- `getApplication()`
23-
- `setRequest($request)`
24-
- `getRequest()`
25-
- `setResponse($response)`
26-
- `getResponse()`
27-
- `setRouter($router)`
28-
- `getRouter()`
29-
- `setRouteMatch($routeMatch)`
30-
- `getRouteMatch()`
31-
- `setResult($result)`
32-
- `getResult()`
33-
- `setViewModel($viewModel)`
34-
- `getViewModel()`
35-
- `isError()`
36-
- `setError()`
37-
- `getError()`
38-
- `getController()`
39-
- `setController($name)`
40-
- `getControllerClass()`
41-
- `setControllerClass($class)`
21+
* `setApplication($application)`
22+
* `getApplication()`
23+
* `setRequest($request)`
24+
* `getRequest()`
25+
* `setResponse($response)`
26+
* `getResponse()`
27+
* `setRouter($router)`
28+
* `getRouter()`
29+
* `setRouteMatch($routeMatch)`
30+
* `getRouteMatch()`
31+
* `setResult($result)`
32+
* `getResult()`
33+
* `setViewModel($viewModel)`
34+
* `getViewModel()`
35+
* `isError()`
36+
* `setError()`
37+
* `getError()`
38+
* `getController()`
39+
* `setController($name)`
40+
* `getControllerClass()`
41+
* `setControllerClass($class)`
4242

4343
The `Application`, `Request`, `Response`, `Router`, and `ViewModel` are all injected during the
4444
`bootstrap` event. Following the `route` event, it will be injected also with the `RouteMatch`

doc/book/zend.mvc.plugins.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ plugins. Additionally, you can register your own custom plugins with the manager
66

77
The built-in plugins are:
88

9-
-
10-
\[Zend\\Mvc\\Controller\\Plugin\\AcceptableViewModelSelector\](zend.mvc.controller-plugins.acceptableviewmodelselector)
11-
- \[Zend\\Mvc\\Controller\\Plugin\\FlashMessenger\](zend.mvc.controller-plugins.flashmessenger)
12-
- \[Zend\\Mvc\\Controller\\Plugin\\Forward\](zend.mvc.controller-plugins.forward)
13-
- \[Zend\\Mvc\\Controller\\Plugin\\Identity\](zend.mvc.controller-plugins.identity)
14-
- \[Zend\\Mvc\\Controller\\Plugin\\Layout\](zend.mvc.controller-plugins.layout)
15-
- \[Zend\\Mvc\\Controller\\Plugin\\Params\](zend.mvc.controller-plugins.params)
16-
- \[Zend\\Mvc\\Controller\\Plugin\\PostRedirectGet\](zend.mvc.controller-plugins.postredirectget)
17-
- \[Zend\\Mvc\\Controller\\Plugin\\Redirect\](zend.mvc.controller-plugins.redirect)
18-
- \[Zend\\Mvc\\Controller\\Plugin\\Url\](zend.mvc.controller-plugins.url)
9+
* \[Zend\\Mvc\\Controller\\Plugin\\AcceptableViewModelSelector\](zend.mvc.controller-plugins.acceptableviewmodelselector)
10+
* \[Zend\\Mvc\\Controller\\Plugin\\FlashMessenger\](zend.mvc.controller-plugins.flashmessenger)
11+
* \[Zend\\Mvc\\Controller\\Plugin\\Forward\](zend.mvc.controller-plugins.forward)
12+
* \[Zend\\Mvc\\Controller\\Plugin\\Identity\](zend.mvc.controller-plugins.identity)
13+
* \[Zend\\Mvc\\Controller\\Plugin\\Layout\](zend.mvc.controller-plugins.layout)
14+
* \[Zend\\Mvc\\Controller\\Plugin\\Params\](zend.mvc.controller-plugins.params)
15+
* \[Zend\\Mvc\\Controller\\Plugin\\PostRedirectGet\](zend.mvc.controller-plugins.postredirectget)
16+
* \[Zend\\Mvc\\Controller\\Plugin\\Redirect\](zend.mvc.controller-plugins.redirect)
17+
* \[Zend\\Mvc\\Controller\\Plugin\\Url\](zend.mvc.controller-plugins.url)
1918

2019
If your controller implements the `setPluginManager`, `getPluginManager` and `plugin` methods, you
2120
can access these using their shortname via the `plugin()` method:
@@ -233,10 +232,10 @@ controller.
233232

234233
The plugin exposes a single method, `dispatch()`, which takes two arguments:
235234

236-
- `$name`, the name of the controller to invoke. This may be either the fully qualified class name,
235+
* `$name`, the name of the controller to invoke. This may be either the fully qualified class name,
237236
or an alias defined and recognized by the `ServiceManager` instance attached to the invoking
238237
controller.
239-
- `$params` is an optional array of parameters with which to seed a `RouteMatch` object for purposes
238+
* `$params` is an optional array of parameters with which to seed a `RouteMatch` object for purposes
240239
of this specific request. Meaning the parameters will be matched by their key to the routing
241240
identifiers in the config (otherwise non-matching keys are ignored)
242241

@@ -313,7 +312,7 @@ The `Layout` plugin allows for changing layout templates from within controller
313312

314313
It exposes a single method, `setTemplate()`, which takes one argument:
315314

316-
- `$template`, the name of the template to set.
315+
* `$template`, the name of the template to set.
317316

318317
As an example:
319318

@@ -381,9 +380,9 @@ session container and redirect the user to a GET request.
381380

382381
This plugin can be invoked with two arguments:
383382

384-
- `$redirect`, a string containing the redirect location which can either be a named route or a URL,
383+
* `$redirect`, a string containing the redirect location which can either be a named route or a URL,
385384
based on the contents of the second parameter.
386-
- `$redirectToUrl`, a boolean that when set to TRUE, causes the first parameter to be treated as a
385+
* `$redirectToUrl`, a boolean that when set to TRUE, causes the first parameter to be treated as a
387386
URL instead of a route name (this is required when redirecting to a URL instead of a route). This
388387
argument defaults to false.
389388

@@ -429,11 +428,11 @@ redirect.
429428

430429
This plugin can be invoked with three arguments:
431430

432-
- `$form`: the form instance.
433-
- `$redirect`: (Optional) a string containing the redirect location which can either be a named
431+
* `$form`: the form instance.
432+
* `$redirect`: (Optional) a string containing the redirect location which can either be a named
434433
route or a URL, based on the contents of the third parameter. If this argument is not provided, it
435434
will default to the current matched route.
436-
- `$redirectToUrl`: (Optional) a boolean that when set to TRUE, causes the second parameter to be
435+
* `$redirectToUrl`: (Optional) a boolean that when set to TRUE, causes the second parameter to be
437436
treated as a URL instead of a route name (this is required when redirecting to a URL instead of a
438437
route). This argument defaults to false.
439438

@@ -487,9 +486,9 @@ if ($form->isValid()) {
487486
Redirections are quite common operations within applications. If done manually, you will need to do
488487
the following steps:
489488

490-
- Assemble a url using the router
491-
- Create and inject a "Location" header into the `Response` object, pointing to the assembled URL
492-
- Set the status code of the `Response` object to one of the 3xx HTTP statuses.
489+
* Assemble a url using the router
490+
* Create and inject a "Location" header into the `Response` object, pointing to the assembled URL
491+
* Set the status code of the `Response` object to one of the 3xx HTTP statuses.
493492

494493
The `Redirect` plugin does this work for you. It offers three methods:
495494

0 commit comments

Comments
 (0)