我有一个指定的路线使用控制器完美地工作。当我链接一个参数验证器以确保传递的问题id
是数字问题时,就会出现一个问题。
Route::get('/question/{id}',
array('as' => 'question_route', 'uses' => 'QuestionsController@showQuestion'))
->where('id',[0-9+]);
Laravel抛出此异常,突出显示->where('id',[0-9+]);
Symfony \ Component \ Debug \ Exception \ FatalErrorException
syntax error, unexpected ']'
三个(as,uses,where)怎么能在一个单一的路线上一起工作呢?
发布于 2014-11-07 04:19:34
您确定正则表达式是[0-9+]
而不是[0-9]+
吗?
它周围应该有单引号
https://stackoverflow.com/questions/26792592
复制相似问题