think_php Portal File Configuration

Source: Internet
Author: User

There are two ways to Think_php's entry mode
1, a portal file corresponding to a project application

2, one entry file for all project applications

By default, the portal file only needs to be require thinkphp folder. For example, the thinkphp file is stored in the think_php folder, so you can refer

Require_once ("/think_php/thinkphp.php");

If you include the project name and turn on debug mode, you can write

Define ("Think_path", "./thinkphp/");d efine ("App_path", "./app/"); Project folder define ("App_name", "index");d efine (' App_debug ', TRUE); Turn on Debug mode require_once (Think_path. " Thinkphp.php ");

This is the app folder and related profiles are automatically generated after accessing the index.php file

If you use the grouping mode, that is, multiple projects corresponding to a portal file, you need to modify the configuration file, if the project folder is an app, then modify app/conf/config.php as follows code (foreground code is home, the acquired code is admin)

Return Array (' app_group_list ' = ' admin,home ', ' default_group ' = ' Home ',);

Then create the admin and home folder under the App folder and create an empty config.php folder to two project folders, the entry file for the next two items is index.php, and the configuration files are in their own folder.

After you create the configuration folder, you also create the Controller folder, under the App/lib/action folder, create the admin and home folder and copy the IndexAction.class.php under action to the home folder. Configuration is complete.

 

think_php Portal File Configuration

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.