Multi-entry settings and binding controllers in thinkphp3.2

Source: Internet
Author: User
Multi-Entrance design

You can set multiple portals for the same application and modules, and different entry files can be set to different application modes or binding modules.

For example, we add a home.php entry file to the index.php file's sibling directory and bind the home module:

<?php

Turn on debug mode suggest that the development phase open the deployment phase annotation or set to false define (' App_debug ', True);

$_get[' m '] = ' home '; Bind Home Module to current entry file//Definition application directory define (' App_path ', './application/');

Introduce the thinkphp entry file require './thinkphp/thinkphp.php '; After the setup completes, enter Http://serverName/index.php/Home/Index/index = http:// Servername/home.php/index/index's finished two entrances.

2, in the same way, we can also bind the controller in the entry file, for example:

$_get[' m '] = ' home '; Bind home module to current portal file

$_get[' c '] = ' Index '; Bind the index controller to the current portal file

Define (' App_path ', './application/');

Require './thinkphp/thinkphp.php ';

After binding, the original access address Http://serverName/index.php/Home/Index/index = Http://serverName/home.php/index

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.