thinkphp3.2 defining multiple modules and setting default modules

Source: Internet
Author: User

Front Entrance file index.php

<?php//+----------------------------------------------------------------------//| thinkphp [WE CAN do IT JUST THINK]//+----------------------------------------------------------------------//| Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.//+-------------------------------------------------- --------------------// | Licensed (http://www.apache.org/licenses/LICENSE-2.0)//+------------------------------------------------------- ---------------// | author:liu21st <[email protected]>//+--------------------------------------------------------------- -------//Application entry file//Detect PHP Environment if (Version_compare (php_version, ' 5.3.0 ', ' < ') die (' Require PHP > 5.3.0! '); /Open debug mode recommend the development phase to open the deployment phase note or set to Falsedefine (' App_debug ', True);//define Runtime directory define (' Runtime_path ', './runtime/');// Define the path of the static page define (' Html_path ', './html/');//define the application directory define (' App_path ', './application/');//define the default module define (' Bind_ MODULE ', ' Home '),//define the site root directory define (' Web_path ', DirName (__file__));//import thinkphp ' import file require '.Thinkphp/thinkphp.php ';//Pro ^_^ You don't need any code behind it, it's so easy. 

Background entry file admin.php

<?php//+----------------------------------------------------------------------//| thinkphp [WE CAN do IT JUST THINK]//+----------------------------------------------------------------------//| Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.//+-------------------------------------------------- --------------------// | Licensed (http://www.apache.org/licenses/LICENSE-2.0)//+------------------------------------------------------- ---------------// | author:liu21st <[email protected]>//+--------------------------------------------------------------- -------//Application entry file//Detect PHP Environment if (Version_compare (php_version, ' 5.3.0 ', ' < ') die (' Require PHP > 5.3.0! '); /Open debug mode recommend the development phase to open the deployment phase note or set to Falsedefine (' App_debug ', True);//define Runtime directory define (' Runtime_path ', './runtime/');// Define the path of the static page define (' Html_path ', './html/');//define the application directory define (' App_path ', './application/');//define the default module define (' Bind_ MODULE ', ' Admin ');//define the site root directory define (' Web_path ', DirName (__file__));//import thinkphp ' import file require './thinkphp/thinkphp.php ';//Pro ^_^ You don't need any code behind it, it's so easy. 

In this way the URL can easily remove the module name, no need to configure the configuration file configuration what default module, what module list,, haha. I have tried, unless you have only one module, and if there are multiple modules, it is best to configure like me ....

thinkphp3.2 defining multiple modules and setting default modules

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.