关于laravel模板中生成URL的几种模式总结
1.通过url辅助函数(路由)生成: location.href = {{url('user/index2')}}; 或者: location.href = {{url::to('user/index2')}}; 2.通过别名(路由)生成,前提是在注册路由的时候要指定别名, 例如: Route::get('user/index2',['as' => 'user/index2', 'uses' => 'UserController@index1']); location.href = {{route('user/index2')}}; 或者: location.href
暂无评论