This article mainly introduces ThinkPHP's precautions for using independent groups, and analyzes the directory structure of independent groups and the mutual calls between groups in depth, I also pointed out the precautions for using ThinkPHP. For more information, see the examples in this article. Share it with you for your reference. The details are as follows:
The independent grouping function of ThinkPHP looks good, but the official website does not provide detailed examples and instructions. here, according to the actual development process, we will give the php developers the following instructions:
1. directory structure of independent groups
Create a Modules folder and configure config.
The code is as follows:
Import ('action. mcorpworkeraction', APP_PATH. 'Les les/base'); // load the Action of the base module by yourself
Import ('Model. CorpworkerModel ', APP_PATH. 'Les les/base ');
// Load the model of the base module by yourself. Otherwise, the methods in the model such as automatic verification will become invalid.
$ Mworker = new McorpworkerAction (); instantiate the action. Be sure to write it fully.
$ Worker ["loginname"] = $ _ REQUEST ['loginname'];
$ Worker ["realname"] = $ _ REQUEST ['realname'];
$ Worker ["pass"] = mmin ($ _ REQUEST ['pass']);
// Construct the data and add it
$ R = $ Mworker-> addfun ($ worker );
// In this way, you can call the addition, deletion, modification, and query of the Mcorpworker of the base module !!
I hope this article will help you with ThinkPHP framework programming.