Use addRoutes() instead of manually creating routes in a loop
authorMatthew Weier O'Phinney <matthew@zend.com>
Wed, 12 Oct 2011 02:37:41 +0000 (21:37 -0500)
committerMatthew Weier O'Phinney <matthew@zend.com>
Wed, 12 Oct 2011 02:37:41 +0000 (21:37 -0500)
modules/Application/src/Application/Bootstrap.php

index a08d0c2..22d89c2 100644 (file)
@@ -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);
     }