1212The base unit of routing is a ` Route ` :
1313
1414``` php
15- namespace Zend\Mvc\ Router;
15+ namespace Zend\Router;
1616
1717use 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
3333class 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
6363interface 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
129129routes, and uses a B-tree algorithm to match routes. As such, you register a
130130single route with many children.
131131
132132A ` 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
154154zend-mvc ships with the following HTTP route types.
155155
156- ### Zend\\ Mvc \\ Router\\ Http\\ Hostname
156+ ### Zend\\ Router\\ Http\\ Hostname
157157
158158The ` Hostname ` route attempts to match the hostname registered in the request
159159against specific criteria. Typically, this will be in one of the following
@@ -198,7 +198,7 @@ $route = Hostname::factory([
198198When matched, the above will return two keys in the ` RouteMatch ` , "subdomain"
199199and "type".
200200
201- ### Zend\\ Mvc \\ Router\\ Http\\ Literal
201+ ### Zend\\ Router\\ Http\\ Literal
202202
203203The ` Literal ` route is for doing exact matching of the URI path. Configuration
204204therefore is solely the path you want to match, and the "defaults", or
@@ -217,7 +217,7 @@ $route = Literal::factory([
217217The 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
222222The ` Method ` route is used to match the HTTP method or 'verb' specified in the
223223request (See RFC 2616 Sec. 5.1.1). It can optionally be configured to match
@@ -236,7 +236,7 @@ $route = Method::factory([
236236The 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
241241A ` Part ` route allows crafting a tree of possible routes based on segments of
242242the 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
358358A `Regex` route utilizes a regular expression to match against the URI path. Any
359359valid 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
386386would be used to fill the specification.
387387
388- ### Zend\\ Mvc \\ Router\\ Http\\ Scheme
388+ ### Zend\\ Router\\ Http\\ Scheme
389389
390390The ` Scheme ` route matches the URI scheme only, and must be an exact match. As
391391such, this route, like the ` Literal ` route, simply takes what you want to match
@@ -403,7 +403,7 @@ $route = Scheme::factory([
403403The above route would match the "https" scheme, and return the key "https" in
404404the ` RouteMatch ` with a boolean ` true ` value.
405405
406- ### Zend\\ Mvc \\ Router\\ Http\\ Segment
406+ ### Zend\\ Router\\ Http\\ Segment
407407
408408A ` Segment ` route allows matching any segment of a URI path. Segments are
409409denoted 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
454454The ` Query ` route part allows you to specify and capture query string parameters
455455for a given route.
@@ -507,7 +507,7 @@ will then be appended as a query string.
507507The 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' => [
0 commit comments