The examples in this article describe the precautions for using independent groups of ThinkPHP. Share it with everyone for your reference. The details are as follows:
Regarding the independent grouping of ThinkPHP, the function seems to be quite good, but the official has not given detailed examples and instructions. Here, based on the actual development process, I will give you the following instructions for PHP developers:
1. Independently grouped directory structure
Same as the official instructions, create the Modules folder and configure config.
Note: Independently grouped actions are placed directly in the action directory, no lib directory is required (This subtle difference troubled me for a day)
2. Mutual calls between independent groups
If you create an independent group specifically to handle the addition, deletion, modification and query of data, when other grouping methods call the addition, deletion, modification and query method of this group, you will find many miracles, such as various non-existent prompts and inexplicable model verification. Failure, etc., are all attributed to one reason: the corresponding module is not automatically loaded! !
So, give up the official method A and load all the modules yourself, for example:
I hope this article will be helpful to everyone’s ThinkPHP framework programming.