-
上篇文章 PHP - Laravel 路由使用(详细) 。
-
路由别名模板
# 路由别名 Route::get('/req', function () { return 'Get请求'; }) -> name('路由别名'); # 通过路由别名获得该路由的 URL 地址 $url = route('路由别名');
-
路由别名例子
# 设置路由别名 Route::get('/req', function () { return 'Get请求'; }) -> name('index.req'); # 获取指定路由别名的 URL 地址 Route::get('/req1', function () { // 返回指定别名 URL 地址 return route('index.req'); });
PHP - Laravel 路由别名
最新推荐文章于 2024-03-13 09:15:11 发布