创建路由如下所示:
Route::get('articles',['uses'=>'ArticlesController@index','as'=>'articles.index']);
要访问该URL可以通过如下形式:
<a href="{{ url('/articles') }}">链接</a><a href="{{ URL::to('/articles') }}">链接</a>
<a href="{{ URL::route('articles.index') }}">链接</a><a href="{{ route('articles.index') }}">链接</a>
<a href="{{ URL::action('ArticlesController@index') }}">链接</a><a href="{{ action('ArticlesController@index') }}">链接</a>
所以在路由配置中,每个参数的代表意义为:
版权声明:本文为博主原创文章,未经博主允许不得转载。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号