Router::scope('/:language/employer/', ['plugin' => 'EmployerPanel'], function ($routes) {
$routes->prefix('employer',function ($routes) {
$routes->connect(':language/:controller',['plugin'=>'EmployerPanel']);
});
$routes->fallbacks('InflectedRoute');
});
这必须与 EmployerPanel 插件中的插件一起使用,页面控制器和操作在家中使用语言en。
http://localhost/mmjob/en/empoyer/pages/home
但它在调试请求中
language => en
controller => Employer
action => pages
pass(array)
plugin(null)
_matchedRoute/:language/:controller/:action/*
_ext(null)
我该如何处理_matchedRoute = /:language/:plugin/:controller:/:action
答案 0 :(得分:0)
试试这个:
Router::plugin(
'EmployerPanel',
['path' => '/employer-panel'],
function ($routes) {
$routes->connect('/:language/employer/', ['plugin' => 'EmployerPanel', 'controller' => 'Pages', 'action' => 'home']);
$routes->fallbacks('InflectedRoute');
}
);
Go to http://localhost/mmjob/employer-panel/en/employer