2015-08-15 64 views
0

module.config.php文件如何将孩子路线添加到bjyauthorize警卫?

....... other route and setting ..... 

    'doctors' => array(
       'type' => 'segment', 
       'options' => array(
        'route' => '/doctors', 
        'defaults' => array(
         'controller' => 'Application\Controller\Index', 
         'action'  => 'doctors', 
        ),      
       ), 
       'may_terminate' => true, 
       'child_routes' => array( 
        'filter' => array(
         'type' => 'segment', 
         'options' => array(
           'route' => '/:type/:search', 
           'defaults' => array(
            'controller' => 'Application\Controller\Index', 
            'action'  => 'doctors', 
           ), 
           'constraints' => array(
            // 'search' => '[a-z0-9]+', 
            'type' => '[a-z0-9]+', 
           ), 
           'defaults' => array(), 
          ), 
        ) , 
       ) 

      ), 

....... other route and setting ..... 

和我bjyauthorize配置这条路是

array('route' => 'doctors', 'roles' => array('admin' , 'doctor' , 'staff' , 'user', 'dps', 'vender' , 'ops' , 'crm' , 'analytic','editer' , 'guest')), 

我现在的问题是

我能够访问

http://BASEURL/doctors 

但我无法访问(不授权)

http://BASEURL/doctors/city/Car-Nicobar 

任何一个可以帮助我做到这一点。 ?

请让我知道你想知道更多的设置。

回答

1

这几天有类似的问题。您需要像这样在父路由之后指定child_routes名称。

旧代码:

array('route' => 'doctors', 'roles' => array('admin' , 'doctor' , 'staff' , 'user', 'dps', 'vender' , 'ops' , 'crm' , 'analytic','editer' , 'guest')),

新代码:

array('route' => 'doctors/filter', 'roles' => array('admin' , 'doctor' , 'staff' , 'user', 'dps', 'vender' , 'ops' , 'crm' , 'analytic','editer' , 'guest')),

相关问题