如何使用laravel获取当前URL的别名?
- 内容介绍
- 文章标签
- 相关推荐
本文共计288个文字,预计阅读时间需要2分钟。
Route::get('/xiongtest', ['as'=> 'xiong.test', 'uses'=> 'XiongTestController@index']);以上路由示例中,在模式中可以使用route('xiong.test')获取该路由的真实地址。在XiongTestController@index中,可以访问该路由的实际地址。
如下所示:
Route::get('/xiongtest', [ 'as' => 'xiong.test', 'uses' => 'XiongTestController@index' ]);
以上路由为例
在模版中可以使用route('xiong.test')来获取该路由的真实地址。
本文共计288个文字,预计阅读时间需要2分钟。
Route::get('/xiongtest', ['as'=> 'xiong.test', 'uses'=> 'XiongTestController@index']);以上路由示例中,在模式中可以使用route('xiong.test')获取该路由的真实地址。在XiongTestController@index中,可以访问该路由的实际地址。
如下所示:
Route::get('/xiongtest', [ 'as' => 'xiong.test', 'uses' => 'XiongTestController@index' ]);
以上路由为例
在模版中可以使用route('xiong.test')来获取该路由的真实地址。

