Hi,
In my blogging module I want to add the administrative route on Bootstrap.  I 
want to do it this way in case I want to add the administrative secction to 
something like ZfcAdmin. In my module.config.php file I've got 
    return array(        'blog' => array(            'admin_route' => 
'blog/admin'        )    );
This way it should be easy to change it to comething like `zfcadmin/blog`.
The problem arrives at the module's `onBootstrap` method... If I try to check 
if the route exists with the following code:
    public function onBootstrap(EventInterface $e)    {        $application    
= $e->getApplication();        $serviceManager = 
$application->getServiceManager();        $router = $e->getRouter();            
        $admin_route = 'blog/admin';                    if( 
$router->hasRoute($admin_route) ) {            die('Got it');        }        
die("No route " . $admin_route);                  }
I always get `No route` although it exists. 
If I go for the parent route, that is `blog`, `hasRoute` returns true... 
however if I get the route using `get->route` I get a 
Zend\Mvc\Router\Http\Part... So I tried:
    $route = $router->get('blog');    if ($route->hasRoute('admin')) {        
die('Got it');    }
But still no luck... I get false.
This makes sense as there is no `hasRoute` or `getRoute` inside 
Zend\Mvc\Router\Http\Part so I guess it is not looking into $childRoutes (which 
I guess it holds the child route I'm looking for) instead it uses the $routes 
variable defined in SimpleRouteStack as it is inherinting the method from it.
Is this a bug? My goal isinserting a simple segment route 
"/[:controller[/:action]]" to the route defined as administrative route for the 
blog module.                                    

Reply via email to