如何将子路由添加到 bjyauthorize guard?
how to add child routes to bjyauthorize guard?
我的 module.config.php 文件是
....... 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
任何人都可以帮助我做到这一点。 ?
请让我知道您想了解更多设置。
这几天遇到了类似的问题。您需要像这样在父路由后指定 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' ) ),
我的 module.config.php 文件是
....... 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
任何人都可以帮助我做到这一点。 ?
请让我知道您想了解更多设置。
这几天遇到了类似的问题。您需要像这样在父路由后指定 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' ) ),