Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated routing

- Simply instantiate router instead of pulling from locator
- Use TreeRouteStack instead of SimpleRouteStack
- Can now pass Config objects directly to addRoutes()
  • Loading branch information...
commit fc9bdb5ff34b78fada3c9d87ad9eccd11b977378 1 parent 5b94b69
@weierophinney authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 modules/site/Bootstrap.php
View
7 modules/site/Bootstrap.php
@@ -8,7 +8,8 @@
Zend\EventManager\StaticEventManager,
Zend\Stdlib\ResponseDescription as Response,
Zend\View\Variables as ViewVariables,
- Zend\Mvc\Application;
+ Zend\Mvc\Application,
+ Zend\Mvc\Router\Http\TreeRouteStack as Router;
class Bootstrap
{
@@ -48,8 +49,8 @@ protected function setupRoutes(Application $app)
* Pull the routing table from configuration, and pass it to the
* router composed in the Application instance.
*/
- $router = $app->getLocator()->get('Zend\Mvc\Router\SimpleRouteStack');
- $router->addRoutes($this->config->routes->toArray());
+ $router = new Router();
+ $router->addRoutes($this->config->routes);
$app->setRouter($router);
}
Please sign in to comment.
Something went wrong with that request. Please try again.