thinkphp use Group details (17)

Source: Internet
Author: User

Original: thinkphp use Group details (17)

Use grouping (module grouping)
* is to merge multiple projects into one project/application (that is, home, Admin)
---groups do not group to see their own establishment of the project habits, personal habits with the root directory configuration to generate front and back project mode,

---Because of the group, to control AH configuration ah, such as files to create their own file directory, trouble


Step One: Configuration file generation corresponding project
├─app--Generate app projects/apps due to portal file configuration
├─thinkphp--Core entry file
├─index.php--Portal configuration file
└─index.php Content
<?php
Define (' App_name ', ' APP ');
Define (' App_path ', './app/');
Define (' App_debug ', true);
Require './thinkphp/thinkphp.php ';
?>
Step Two:
Configure the grouping->e:\wamp\www\thinkphp2\app\conf\config.php plus configuration in the App configuration file
<?php
Return Array (
' Config item ' = ' config value '
' App_group_list ' = ' home,admin ',//Project grouping settings
' Default_group ' = ' Home ',//default grouping
);
?>

Step Three:
Note: After configuring http://localhost/thinkphp/you are not accessible in access because the group was started
Http://localhost/thinkphp/index.php/Home/Index/index's going to be so accessible.
However: (Do not make the group access in the control also OK)
├─app
├─app\lib\action
├─home
│ └─indexaction.class.php
├─admin
│ └─indexaction.class.php
* This is only a group access: Http://localhost/thinkphp/index.php/Home/Index/index


--but each group uses its own configuration file.
1: The configured directory after grouping
Conf
├─home Group: conf/home/config.php
├─admin Group: conf/admin/config.php
└─ Public configuration: conf/config.php
2: Do not group configuration directory
conf/config.php

thinkphp use Group details (17)

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.