thinkphp5 module design

Mainly contains the controller folder and the view folder;

You can also set configuration files and functions of this module separately for this module;

Simple to use:

The built-in controller does not inherit any basic class, and can inherit the official packaged \ think \ Controller class when used.

Access a method under this controller via url:

How to enter the view page through the controller

Create a new view folder at the same level as the controller folder, create a new folder index under the view, this file name is the same as the index.php file under the controller, and then create an index.html under the index file, this file name corresponds to index The name of the method in .php.

By using return $ this-> fetch (); in the controller method, you can open the corresponding view page.

Guess you like

Origin www.cnblogs.com/ltl11230/p/12761335.html
Recommended