Home > php教程 > php手册 > body text

Some suggestions about routing groups in ThinkPHP 5

WBOY
Release: 2016-10-17 09:12:07
Original
1741 people have browsed it

Go straight to the content
Route::rule('ha','index/Index/hello');<br> <br> # Set up Index routing group<br> Route::group('index',[<br> 'ha' => ['index/Index/hello'],<br> ],['method'=>'get']);In the default module, the ha in the group must be accessed through the index/prefix.
For single records, rules are not required.

In this way, if you want to manage the routes of the index group through the routing group, you must access them all through index/prefix


I suggest that TP officials can bind the default module to the index routing group in a later version, so that the front-end URL will be more beautiful.... (Although the above two routes are independent, once bound It will be difficult to monitor the priority level, or there may only be one of them, but I hope the URL will look better...)

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template