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

Commit 525c1f1

Browse files
committed
[Docs] Fixes bullet lists - See #60
1 parent eed620c commit 525c1f1

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.
@@ -162,15 +162,15 @@ The `view` directory contains view scripts related to your controllers.
162162

163163
The `Application` has six basic dependencies.
164164

165-
- **configuration**, usually an array or object implementing `Traversable`.
166-
- **ServiceManager** instance.
167-
- **EventManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
165+
* **configuration**, usually an array or object implementing `Traversable`.
166+
* **ServiceManager** instance.
167+
* **EventManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
168168
name "EventManager".
169-
- **ModuleManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
169+
* **ModuleManager** instance, which, by default, is pulled from the `ServiceManager`, by the service
170170
name "ModuleManager".
171-
- **Request** instance, which, by default, is pulled from the `ServiceManager`, by the service name
171+
* **Request** instance, which, by default, is pulled from the `ServiceManager`, by the service name
172172
"Request".
173-
- **Response** instance, which, by default, is pulled from the `ServiceManager`, by the service name
173+
* **Response** instance, which, by default, is pulled from the `ServiceManager`, by the service name
174174
"Response".
175175

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

199-
- Attaches the default route listener (`Zend\Mvc\RouteListener`).
200-
- Attaches the default dispatch listener (`Zend\Mvc\DispatchListener`).
201-
- Attaches the `ViewManager` listener (`Zend\Mvc\View\ViewManager`).
202-
- Creates the `MvcEvent`, and injects it with the application, request, and response; it also
199+
* Attaches the default route listener (`Zend\Mvc\RouteListener`).
200+
* Attaches the default dispatch listener (`Zend\Mvc\DispatchListener`).
201+
* Attaches the `ViewManager` listener (`Zend\Mvc\View\ViewManager`).
202+
* Creates the `MvcEvent`, and injects it with the application, request, and response; it also
203203
retrieves the router (`Zend\Mvc\Router\Http\TreeRouteStack`) at this time and attaches it to the
204204
event.
205-
- Triggers the "bootstrap" event.
205+
* Triggers the "bootstrap" event.
206206

207207
If you do not want these actions, or want to provide alternatives, you can do so by extending the
208208
`Application` class and/or simply coding what actions you want to occur.
@@ -260,22 +260,21 @@ $configuration = include 'config/application.config.php';
260260
Application::init($configuration)->run();
261261
```
262262

263-
The `init()` method will basically do the following:
264-
- Grabs the application configuration and pulls from the `service_manager` key, creating a
265-
`ServiceManager`
266-
instance with it and with the default services shipped with `Zend\Mvc`;
263+
The `init()` method will basically do the following:
267264

268-
- Create a service named `ApplicationConfig` with the application configuration array;
269-
- Grabs the `ModuleManager` service and load the modules;
270-
- `bootstrap()`s the `Application` and returns its instance;
265+
* Grabs the application configuration and pulls from the `service_manager` key, creating a
266+
`ServiceManager` instance with it and with the default services shipped with `Zend\Mvc`;
267+
* Create a service named `ApplicationConfig` with the application configuration array;
268+
* Grabs the `ModuleManager` service and load the modules;
269+
* `bootstrap()`s the `Application` and returns its instance;
271270

272271
> ## Note
273272
If you use the `init()` method, you cannot specify a service with the name of 'ApplicationConfig' in
274273
your service manager config. This name is reserved to hold the array from application.config.php.
275274
The following services can only be overridden from application.config.php:
276-
- `ModuleManager`
277-
- `SharedEventManager`
278-
- `EventManager` & `Zend\EventManager\EventManagerInterface`
275+
* `ModuleManager`
276+
* `SharedEventManager`
277+
* `EventManager` & `Zend\EventManager\EventManagerInterface`
279278
All other services are configured after module loading, thus can be overridden by modules.
280279

281280
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

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

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

315-
- `$template`, the name of the template to set.
314+
* `$template`, the name of the template to set.
316315

317316
As an example:
318317

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

381380
This plugin can be invoked with two arguments:
382381

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

@@ -428,11 +427,11 @@ redirect.
428427

429428
This plugin can be invoked with three arguments:
430429

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

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

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.
488+
* Assemble a url using the router
489+
* Create and inject a "Location" header into the `Response` object, pointing to the assembled URL
490+
* Set the status code of the `Response` object to one of the 3xx HTTP statuses.
492491

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

0 commit comments

Comments
 (0)