ThinkPhp3.2.3 multi-project Background App interface design Framework Design

Source: Internet
Author: User
Tags get ip

↓↓↓ Project file Components ↓↓↓

App file is backstage, index.php is portal file

Interface file is an interface, note here do not use the API name! There may be a problem! interface.php is a portal file

Note: The only difference between the two entry files is that interface is set more than one line of the app portal file
//Application API mode
define (' App_mode ', ' API ');
This means that the project refers to the API mode, in the 3.2.3 model, you can see the API, Lite, SAE three folders, and the same name of three PHP files and a common.php file!

The difference in API mode settings is evident in the Controller.class.php (API mode controller base class) under the API folder, where he has only nearly 100 lines of code.

The most obvious difference is that we can do a test!
Your display () output page in the app project! If you delete the corresponding view under the template, will error template can not recruit!
But in the API mode display (), will tell you that this method does not exist!

In other words: When we use the interface mode, the execution efficiency will be higher than the default way!
It can be seen from the initialization of two base classes! The default common will instantiate an attempt to $view, and the API mode base class will only execute the initialization method in your instance class.

In addition, people are more concerned about the htaccess 
Rewriterule ^web (. *) index< Span id= "mathjax-span-872" class= "Mo". ph p/ 1 [qsa,pt,l]

Rewriterule ^interface (. *) i nt er fa ce ph p/ 1 [qsa,pt,l]

Oh da!

With description: 3.2.3 's framework enriches a lot of plugins, there are a lot of good things under the library! Get IP, string, date processing, stacks, permissions, encryption, images and more! Some do not have to go to the Internet to find, you can go to the framework to look well, to avoid the project composition too heavy!

ThinkPhp3.2.3 multi-project Background App interface design Framework Design

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.