From: Matthew Weier O'Phinney Date: Wed, 12 Oct 2011 02:37:41 +0000 (-0500) Subject: Use addRoutes() instead of manually creating routes in a loop X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=27b7fadcc885ac4c0ece6db351e6ad910587f1a4;p=zf2.biz%2Fapplication_blanche.git Use addRoutes() instead of manually creating routes in a loop --- diff --git a/modules/Application/src/Application/Bootstrap.php b/modules/Application/src/Application/Bootstrap.php index a08d0c2..22d89c2 100644 --- a/modules/Application/src/Application/Bootstrap.php +++ b/modules/Application/src/Application/Bootstrap.php @@ -42,12 +42,7 @@ class Bootstrap protected function setupRoutes(Application $app) { $router = $app->getLocator()->get('Zend\Mvc\Router\SimpleRouteStack'); - foreach ($this->config->routes as $name => $config) { - $class = $config->type; - $options = $config->options; - $route = new $class($options); - $router->addRoute($name, $route); - } + $router->addRoutes($this->config->routes->toArray()); $app->setRouter($router); }