Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5-带斜线的路线参数_Php_Laravel - Fatal编程技术网

Php Laravel 5-带斜线的路线参数

Php Laravel 5-带斜线的路线参数,php,laravel,Php,Laravel,我在旧的laravel 5.0项目路线中遇到了一个问题,因为我需要传递一个参数,该参数有时可能包含/ 我这样做: Route::get('/app/budget/search/{text?}/{column}', 'BudgetController@search')->where('text', '(.*)'); 但是不起作用。 我的laravel项目版本是5.0这仅在文本是最后一个参数时有效,否则无法将文本与列区分开来。定义两个满足这两个条件的路由。您需要编写一个更复杂的正则表达式,定

我在旧的laravel 5.0项目路线中遇到了一个问题,因为我需要传递一个参数,该参数有时可能包含
/

我这样做:

Route::get('/app/budget/search/{text?}/{column}', 'BudgetController@search')->where('text', '(.*)');
但是不起作用。
我的laravel项目版本是
5.0

这仅在文本是最后一个参数时有效,否则无法将文本与列区分开来。定义两个满足这两个条件的路由。您需要编写一个更复杂的正则表达式,定义一个非贪婪运算符或仅选择一个slaches。