THINKPHP3.X constant Collation (predefined constant/Path constants/System constants) _php instances

Source: Internet
Author: User
Tags php template smarty template

This paper summarizes the constants commonly used in thinkphp3.x. Share to everyone for your reference, specific as follows:

First, predefined constants

url_common=0 Normal Mode URL
Url_pathinfo=1 PathInfo URL
url_rewrite=2 REWRITE URL
url_compat=3 compatibility Mode URL
Has_one=1 Has_one Association Definition
belongs_to=2 Belongs_to Association Definition
Has_many=3 Has_many Association Definition
Many_to_many=4 Many_to_many Association Definition
Think_version Frame Version number

These predefined constants do not change as the environment changes.

Two, the path constant

The system and project path constants are used for the system default catalog specification, which can be redefined by redefining changes, which generally do not need to be changed if you do not want to customize the catalog.

Core_path system core Class Library directory Think_path. ' lib/'
Extend_path System Extended Directory Think_path. ' extend/'
Mode_path schema Extended directory extend_path. ' mode/'
Engine_path Engine Extended directory Extend_path. ' engine/'
Vendor_path third-party class library directory Extend_path ' vendor/'
Library_path system Extended Class Library directory Extend_path. ' library/'
Common_path Project Public directory App_path. ' common/'
Lib_path Project Class Library directory App_path. ' lib/'
Runtime_path Project Runtime directory app_path. ' runtime/'
Conf_path project configuration directory app_path. ' conf/'
Log_path Project Log directory runtime_path. ' logs/'
Cache_path project Template Cache directory Runtime_path. ' cache/'
Lang_path Project Language Pack directory App_path. ' lang/'
Temp_path Project Cache directory runtime_path. ' temp/'
Data_path Project Data Directory Runtime_path. ' data/'
Tmpl_path Project Template directory App_path. ' tpl/'
Html_path project static Cache directory App_path. ' html/'

Third, System constants

The following system constants will change as the development environment changes or settings change.

Whether is_cgi belongs to the CGI mode
Whether Is_win belongs to the Windows environment
Is_cli whether it belongs to the command line mode
__root__ Site root directory Address
__APP__ Current project (entry file) address
__group__ the URL address of the current group
__url__ the current module's URL address
__action__ the URL address of the current operation
__self__ Current URL Address
__info__ the current Path_info string
App_name Current project Name
Group_name Current group Name
Module_name the current module name
Action_name Current operation name
App_debug whether debug mode is turned on
Mode_name Current Mode Name
App_path Current Project Path
Think_path System Framework Path
MEMORY_LIMIT_ON System Memory Statistics support
Runtime_file Project compile cache filename
Theme_name Current topic name
Theme_path the current template topic path
App_tmpl_path Current Template URL path
Lang_set Current Browser language
MAGIC_QUOTES_GPC MAGIC_QUOTES_GPC

More interested in thinkphp related content readers can view the site topics: "thinkphp Introductory Course", "thinkphp Common Methods Summary", "PHP Cookie Usage Summary", "Smarty Template Introductory Course" and "PHP template technology Summary."

I hope this article will help you with the PHP program design based on thinkphp framework.

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.