1
$suffix = '.test';
Route::get('article/edit/{name?}'.$suffix, ['uses' => '[email protected]', 'as' => 'Edit']);
,而且运作良好。然后,我在身份验证组中添加,$名称始终以$后缀返回(例如:$ NAME = 'abc.test')
Route::group(['middleware' => 'auth'], function() {
global $suffix;
Route::get('article/edit/{name?}'.$suffix, ['uses' => '[email protected]', 'as' => 'Edit']);
});
但我想它返回$名称= 'ABC'; 我错在哪里?
它返回:ErrorException在UriValidator.php线21:的preg_match():编译失败:范围乱序在字符类在偏移31 – thai6070
其中( '姓名',“/ [^ A-ZA-Z0 -9 _ \ .-] /')效果很好 – thai6070
完美!我了解该主题已关闭吗? :) –