【发布时间】:2014-05-04 12:10:51
【问题描述】:
我不确定执行此操作的最佳方法,因此将电流与数组进行比较正是我目前的想法。
我想让一组路由执行一个过滤器,然后根据该路由产生与该过滤器不同的结果。类似于
if(in_array($currentRoute, $allowedRoutes){
do action1
}
else{
do action2
}
就 uri 而言,我有许多不同的可能性
Route::get('/content','ContentController@index')
Route::post('/dynamic/{dynamic}','DynamicController@store')
Route::delete('dynamic/{dynamic}/content/{content}','ContentController@destroy')
以上所有可能都有查询字符串,并且都有许多 HTTP 方法。解决此问题的最佳方法是什么?
【问题讨论】:
标签: php laravel-4 compare laravel-routing