Precautions for using independent groups

Source: Internet
Author: User
The independent grouping of tp looks good, but the official team does not provide detailed examples and instructions. here, based on my actual development process, I will give the following instructions: the independent grouping of tp looks good, but the official team does not provide detailed examples and instructions. here, based on my actual development process, I will give the following instructions:
1. directory structure of independent groups.
Create a Modules folder, configure config,
Note: the action of the independent group is directly placed in the action directory, and the lib directory is not required !!
This subtle difference has pitted me for a day !!
2. Mutual calls between independent groups:
If you create an independent group to specifically process the addition, deletion, modification, and query of data, you will find many miracles when the methods of other groups call the addition, deletion, modification, and query methods of this group, for example, there are various non-existent prompts, and model verification is inexplicably ineffective. This is due to one reason: the corresponding module is not automatically loaded !!
Therefore, give up the official A method and load all modules by yourself, for example:

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 !!

Pay attention to independent groups.
If you have any good official instructions, please click it! We are looking forward to improvement.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.