php - laravel route parsing error after url encoding of routing parameters
PHP中文网
PHP中文网 2017-06-22 11:54:11
0
2
887

I encode the parameters

$msg = '这是测试 点击 <a href="/new/abc" > 测试 </a> 进行跳转';
$msg = urlencode(base64_encode($msg));
return redirect()->route('test', ['id' => 10, 'msg'=>$msg]);

Route definition

Route::get('/test/{id}/msg/{msg?}', 'TestrController@index')->name('test');

I found that the encoded $msg will cause routing parsing errors. I tested it like this /test/1/msg/balabala No problem

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
習慣沉默

I copied and pasted your code into my project and tested it without error -- Laravel5.4

大家讲道理

This is a laravel project, what function are you doing? It should be time compensation, right? You can't pass parameters in this way when routing, right? If you explain it in more detail, I think I can help you. I have just done the function of passing multiple parameters. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template