0
在路由过滤器的IM试图确定路线参数被调用时,它可能为空,但我仍然需要知道,如果它被称为...检查是否路由参数被称为
例如
if(// IS ROUTE "job" being called ?) {
if(is_null($job = $route->getParameter('job'))) {
return App::abort(404, 'This job does not exist.'); // Show the not found page
}
elseif($job->agency->id != $agency->id) {
return App::abort(403, 'You are not authorized to view this job.'); // Show the insufficient permissions page
}
}
你的意思是用文字“路径参数”?该网址参数是? – Andreyco
路由参数与正在应用于该路由的变量... AKA Route :: post('{agency}/job/view/{job}','Controllers \ Agency \ JobController @ postEdit “); – AndrewMcLagan