2015-08-15 60 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')),

相關問題