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

Commit 56edab9

Browse files
committed
Merge branch 'hotfix/docs-router'
2 parents 2d94ef3 + 93042e0 commit 56edab9

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

doc/book/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The above can be useful when composing event listeners into your controller.
3333
### Accessing routing parameters
3434

3535
The parameters returned when routing completes are wrapped in a
36-
`Zend\Mvc\Router\RouteMatch` object. This object is detailed in the section on
36+
`Zend\Router\RouteMatch` object. This object is detailed in the section on
3737
[Routing](routing.md).
3838

3939
Within your controller, if you implement `InjectApplicationEventInterface` (as

doc/book/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ The MVC layer is built on top of the following components:
1717
correctly with the SAPI and output buffering.
1818
- zend-stdlib - specifically `Zend\Stdlib\DispatchableInterface`. All
1919
"controllers" are simply dispatchable objects.
20+
- zend-router - provides routing of a request. In other
21+
words, it matches the request to its respective controller (or dispatchable).
2022

2123
Within the MVC layer, several sub-components are exposed:
2224

23-
- `Zend\Mvc\Router` contains classes pertaining to routing a request. In other
24-
words, it matches the request to its respective controller (or dispatchable).
2525
- `Zend\Mvc\Controller`, a set of abstract "controller" classes with basic
2626
responsibilities such as event wiring, action dispatching, etc., as well as
2727
controller plugins.
@@ -247,7 +247,7 @@ the application. In the default implementation, this does the following:
247247
- Attaches the default dispatch listener (`Zend\Mvc\DispatchListener`).
248248
- Attaches the `ViewManager` listener (`Zend\Mvc\View\ViewManager`).
249249
- Creates the `MvcEvent`, and injects it with the application, request, and
250-
response; it also retrieves the router (`Zend\Mvc\Router\Http\TreeRouteStack`)
250+
response; it also retrieves the router (`Zend\Router\Http\TreeRouteStack`)
251251
at this time and attaches it to the event.
252252
- Triggers the "bootstrap" event.
253253

doc/book/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ Now that we have a controller and a view script, we need to create a route to it
217217
>
218218
> We're going to create an explicit route in this example, as
219219
> creating explicit routes is a recommended practice. The application will look for a
220-
> `Zend\Mvc\Router\RouteStackInterface` instance to setup routing. The default generated router is a
221-
> `Zend\Mvc\Router\Http\TreeRouteStack`.
220+
> `Zend\Router\RouteStackInterface` instance to setup routing. The default generated router is a
221+
> `Zend\Router\Http\TreeRouteStack`.
222222
>
223223
> To use the "default route" functionality, you will need to edit the shipped
224224
> routing definition in the module's `config/module.config.php`, and replace:

doc/book/routing.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ more.
1212
The base unit of routing is a `Route`:
1313

1414
```php
15-
namespace Zend\Mvc\Router;
15+
namespace Zend\Router;
1616

1717
use Zend\Stdlib\RequestInterface as Request;
1818

@@ -28,7 +28,7 @@ A `Route` accepts a `Request`, and determines if it matches. If so, it returns a
2828
`RouteMatch` object:
2929

3030
```php
31-
namespace Zend\Mvc\Router;
31+
namespace Zend\Router;
3232

3333
class RouteMatch
3434
{
@@ -58,7 +58,7 @@ facilitate this, you will use a route aggregate, usually implementing
5858
`RouteStack`:
5959

6060
```php
61-
namespace Zend\Mvc\Router;
61+
namespace Zend\Router;
6262

6363
interface RouteStackInterface extends RouteInterface
6464
{
@@ -125,15 +125,15 @@ adding it to the route stack.
125125

126126
### TreeRouteStack
127127

128-
`Zend\Mvc\Router\Http\TreeRouteStack` provides the ability to register trees of
128+
`Zend\Router\Http\TreeRouteStack` provides the ability to register trees of
129129
routes, and uses a B-tree algorithm to match routes. As such, you register a
130130
single route with many children.
131131

132132
A `TreeRouteStack` will consist of the following configuration:
133133

134134
- A base "route", which describes the base match needed, the root of the tree.
135135
- An optional `route_plugins`, which is a configured
136-
`Zend\Mvc\Router\RoutePluginManager` that can lazy-load routes.
136+
`Zend\Router\RoutePluginManager` that can lazy-load routes.
137137
- The option `may_terminate`, which hints to the router that no other segments
138138
will follow it.
139139
- An optional `child_routes` array, which contains additional routes that stem
@@ -153,7 +153,7 @@ route.
153153

154154
zend-mvc ships with the following HTTP route types.
155155

156-
### Zend\\Mvc\\Router\\Http\\Hostname
156+
### Zend\\Router\\Http\\Hostname
157157

158158
The `Hostname` route attempts to match the hostname registered in the request
159159
against specific criteria. Typically, this will be in one of the following
@@ -198,7 +198,7 @@ $route = Hostname::factory([
198198
When matched, the above will return two keys in the `RouteMatch`, "subdomain"
199199
and "type".
200200

201-
### Zend\\Mvc\\Router\\Http\\Literal
201+
### Zend\\Router\\Http\\Literal
202202

203203
The `Literal` route is for doing exact matching of the URI path. Configuration
204204
therefore is solely the path you want to match, and the "defaults", or
@@ -217,7 +217,7 @@ $route = Literal::factory([
217217
The above route would match a path "/foo", and return the key "action" in the
218218
`RouteMatch`, with the value "foo".
219219

220-
### Zend\\Mvc\\Router\\Http\\Method
220+
### Zend\\Router\\Http\\Method
221221

222222
The `Method` route is used to match the HTTP method or 'verb' specified in the
223223
request (See RFC 2616 Sec. 5.1.1). It can optionally be configured to match
@@ -236,7 +236,7 @@ $route = Method::factory([
236236
The above route would match an http "POST" or "PUT" request and return a
237237
`RouteMatch` object containing a key "action" with a value of "form-submit".
238238

239-
### Zend\\Mvc\\Router\\Http\\Part
239+
### Zend\\Router\\Http\\Part
240240

241241
A `Part` route allows crafting a tree of possible routes based on segments of
242242
the URI path. It actually extends the `TreeRouteStack`.
@@ -328,32 +328,32 @@ You may use any route type as a child route of a `Part` route.
328328
> ### Route plugins
329329
>
330330
> In the above example, the `$routePlugins` is an instance of
331-
> `Zend\Mvc\Router\RoutePluginManager`, containing essentially the following
331+
> `Zend\Router\RoutePluginManager`, containing essentially the following
332332
> configuration:
333333
>
334334
> ```php
335-
> $routePlugins = new Zend\Mvc\Router\RoutePluginManager();
335+
> $routePlugins = new Zend\Router\RoutePluginManager();
336336
> $plugins = [
337-
> 'hostname' => 'Zend\Mvc\Router\Http\Hostname',
338-
> 'literal' => 'Zend\Mvc\Router\Http\Literal',
339-
> 'part' => 'Zend\Mvc\Router\Http\Part',
340-
> 'regex' => 'Zend\Mvc\Router\Http\Regex',
341-
> 'scheme' => 'Zend\Mvc\Router\Http\Scheme',
342-
> 'segment' => 'Zend\Mvc\Router\Http\Segment',
343-
> 'wildcard' => 'Zend\Mvc\Router\Http\Wildcard',
344-
> 'query' => 'Zend\Mvc\Router\Http\Query',
345-
> 'method' => 'Zend\Mvc\Router\Http\Method',
337+
> 'hostname' => 'Zend\Router\Http\Hostname',
338+
> 'literal' => 'Zend\Router\Http\Literal',
339+
> 'part' => 'Zend\Router\Http\Part',
340+
> 'regex' => 'Zend\Router\Http\Regex',
341+
> 'scheme' => 'Zend\Router\Http\Scheme',
342+
> 'segment' => 'Zend\Router\Http\Segment',
343+
> 'wildcard' => 'Zend\Router\Http\Wildcard',
344+
> 'query' => 'Zend\Router\Http\Query',
345+
> 'method' => 'Zend\Router\Http\Method',
346346
> ];
347347
> foreach ($plugins as $name => $class) {
348348
> $routePlugins->setInvokableClass($name, $class);
349349
> }
350350
> ```
351351
>
352-
> When using `Zend\Mvc\Router\Http\TreeRouteStack`, the `RoutePluginManager` is
352+
> When using `Zend\Router\Http\TreeRouteStack`, the `RoutePluginManager` is
353353
> set up by default, and the developer does not need to worry about autoloading
354354
> of standard HTTP routes.
355355
356-
### Zend\\Mvc\\Router\\Http\\Regex
356+
### Zend\\Router\\Http\\Regex
357357
358358
A `Regex` route utilizes a regular expression to match against the URI path. Any
359359
valid regular expression is allowed; our recommendation is to use named captures
@@ -385,7 +385,7 @@ items in the `RouteMatch`, an "id", the "controller", the "action", and the
385385
"format". When assembling a URL from this route, the "id" and "format" values
386386
would be used to fill the specification.
387387

388-
### Zend\\Mvc\\Router\\Http\\Scheme
388+
### Zend\\Router\\Http\\Scheme
389389

390390
The `Scheme` route matches the URI scheme only, and must be an exact match. As
391391
such, this route, like the `Literal` route, simply takes what you want to match
@@ -403,7 +403,7 @@ $route = Scheme::factory([
403403
The above route would match the "https" scheme, and return the key "https" in
404404
the `RouteMatch` with a boolean `true` value.
405405

406-
### Zend\\Mvc\\Router\\Http\\Segment
406+
### Zend\\Router\\Http\\Segment
407407

408408
A `Segment` route allows matching any segment of a URI path. Segments are
409409
denoted using a colon, followed by alphanumeric characters; if a segment is
@@ -440,7 +440,7 @@ $route = Segment::factory([
440440
]);
441441
```
442442

443-
### Zend\\Mvc\\Router\\Http\\Query (Deprecated)
443+
### Zend\\Router\\Http\\Query (Deprecated)
444444

445445
> #### Potential security issue
446446
>
@@ -449,7 +449,7 @@ $route = Segment::factory([
449449
> #### Deprecated
450450
>
451451
> This route part is deprecated since you can now add query parameters without a
452-
> query route.
452+
> query route. It was removed in version 3 of the router.
453453
454454
The `Query` route part allows you to specify and capture query string parameters
455455
for a given route.
@@ -507,7 +507,7 @@ will then be appended as a query string.
507507
The output from our example should then be
508508
`/page/my-test-page?format=rss&limit=10`
509509

510-
### Zend\\Mvc\\Router\\Http\\Wildcard (Deprecated)
510+
### Zend\\Router\\Http\\Wildcard (Deprecated)
511511

512512
> #### Potential security issue
513513
>
@@ -632,7 +632,7 @@ return [
632632
'router' => [
633633
'routes' => [
634634
'modules.zendframework.com' => [
635-
'type' => 'Zend\Mvc\Router\Http\Hostname',
635+
'type' => 'Zend\Router\Http\Hostname',
636636
'options' => [
637637
'route' => ':4th.[:3rd.]:2nd.:1st', // domain levels from right to left
638638
'constraints' => [
@@ -647,7 +647,7 @@ return [
647647
// child route controllers may span multiple modules as desired
648648
'child_routes' => [
649649
'index' => [
650-
'type' => 'Zend\Mvc\Router\Http\Literal',
650+
'type' => 'Zend\Router\Http\Literal',
651651
'options' => [
652652
'route' => '/',
653653
'defaults' => [
@@ -660,7 +660,7 @@ return [
660660
],
661661
],
662662
'packages.zendframework.com' => [
663-
'type' => 'Zend\Mvc\Router\Http\Hostname',
663+
'type' => 'Zend\Router\Http\Hostname',
664664
'options' => [
665665
'route' => ':4th.[:3rd.]:2nd.:1st', // domain levels from right to left
666666
'constraints' => [
@@ -675,7 +675,7 @@ return [
675675
// child route controllers may span multiple modules as desired
676676
'child_routes' => [
677677
'index' => [
678-
'type' => 'Zend\Mvc\Router\Http\Literal',
678+
'type' => 'Zend\Router\Http\Literal',
679679
'options' => [
680680
'route' => '/',
681681
'defaults' => [

doc/book/services.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ services configured out of the box.
130130
- If the `charset` subkey is present, the value is used to set the adapter
131131
charset.
132132

133-
- `ConsoleRouter`, mapping to `Zend\Mvc\Service\ConsoleRouterFactory`. This
133+
- `ConsoleRouter`, mapping to `Zend\Mvc\Console\Router\ConsoleRouterFactory`. This
134134
grabs the `Config` service, and pulls from the `console` key and `router`
135-
subkey, configuring a `Zend\Mvc\Router\Console\SimpleRouteStack` instance.
135+
subkey, configuring a `Zend\Mvc\Console\Router\SimpleRouteStack` instance.
136136

137137
- `ConsoleViewManager`, mapping to `Zend\Mvc\Service\ConsoleViewManagerFactory`.
138138
This creates and returns an instance of `Zend\Mvc\View\Console\ViewManager`,
@@ -176,9 +176,9 @@ services configured out of the box.
176176
It also uses the `DiAbstractServiceFactory` service, effectively allowing
177177
you to fall back to DI in order to retrieve form elements.
178178

179-
- `HttpRouter`, mapping to `Zend\Mvc\Service\HttpRouterFactory`. This grabs
179+
- `HttpRouter`, mapping to `Zend\Router\Http\HttpRouterFactory`. This grabs
180180
the `Config` service, and pulls from the `router` key, configuring a
181-
`Zend\Mvc\Router\Http\TreeRouteStack` instance.
181+
`Zend\Router\Http\TreeRouteStack` instance.
182182

183183
- `HttpViewManager`, mapping to `Zend\Mvc\Service\HttpViewManagerFactory`.
184184
This creates and returns an instance of `Zend\Mvc\View\Http\ViewManager`,
@@ -235,12 +235,12 @@ services configured out of the box.
235235
create a `Zend\Console\Response`; otherwise, for HTTP environments, it
236236
creates a `Zend\Http\PhpEnvironment\Response`.
237237

238-
- `Router`, mapping to `Zend\Mvc\Service\RouterFactory`. If in a console
238+
- `Router`, mapping to `Zend\Router\RouterFactory`. If in a console
239239
environment, it proxies to the `ConsoleRouter` service; otherwise, it proxies
240240
to the `HttpRouter` service.
241241

242242
- `RoutePluginManager`, mapping to `Zend\Mvc\Service\RoutePluginManagerFactory`.
243-
This instantiates the `Zend\Mvc\Router\RoutePluginManager` instance, passing
243+
This instantiates the `Zend\Router\RoutePluginManager` instance, passing
244244
it the service manager instance; this is used to manage [route types](routing.md#http-route-types).
245245
It also uses the `DiAbstractServiceFactory` service, effectively allowing
246246
you to fall back to DI in order to retrieve route types.
@@ -488,7 +488,7 @@ The following plugin managers are configured by default:
488488
and used to manage hydrator instances.
489489
- **InputFilterManager**, corresponding to `Zend\InputFilter\InputFilterPluginManager`,
490490
and used to manage input filter instances.
491-
- **RoutePluginManager**, corresponding to `Zend\Mvc\Router\RoutePluginManager`,
491+
- **RoutePluginManager**, corresponding to `Zend\Router\RoutePluginManager`,
492492
and used to manage route instances.
493493
- **SerializerAdapterManager**, corresponding to `Zend\Serializer\AdapterPluginManager`,
494494
and used to manage serializer instances.

0 commit comments

Comments
 (0)