thinkphp function Library notes (common.php_3.1.2 version)

Source: Internet
Author: User

0. loading file: File_exists_case,require_cache,require_array,import,load,vendor,alias_import

* 1, File_exists_case: Determine whether the file exists (case-sensitive). This function is for Windows system, because the file/folder is not case-sensitive under Windows system, so the string used by PHP is case-insensitive, but it is case-sensitive under the Linux system and cannot be read if the string is different. Therefore, in Windows system use, you need to pay special attention to the case of file names, this is to facilitate the migration.

2, require_cache:require_once the optimized version, because the function is not high performance.

3, Require_array: Bulk Load File method, that is, the use of the 2 method of recycling.

4, Alias_import: Alias loading, is to give a complex path file in advance a short alias, make loading more convenient.

5. Import: Loads the class file at the specified location in the specified format. Reference: http://www.jb51.net/article/51765.htm
6, Vendor: Dedicated facilitates third-party class library files.

7. Load: Loads the function library file, not the class library file.

1, a method: Instantiation controller

2. R method: Remotely invoke a method in a controller, where the remote is usually referred to in another controller. The method is an extension of the A method, which is to instantiate a controller class before invoking the method. The first parameter is a URL format.

3. D Method: Instantiate a custom class that is used to complete some kind of business logic. Of course, you can also generate the base model class.

4, M Method: Instantiate the underlying model class, or a custom other public model class. The basic model class provided by thinkphp encapsulates database operations, which also illustrates the main role of PHP.

Save, C method: Get and set configuration information. The way to load the default configuration information is related to the function of return in PHP.

6, L Method: Get and set the language definition, support batch setup. Language packs have two functions: one is the definition of convenient language, not hard coding, and the other is for the development of internationalization.

7, N method

8, G Method: Time and memory cost record. Typically used for the former, one parameter is marked with a time, and multiple parameters can be calculated using the duration. and store the statistical results in an array for later use.

9, Trace method: Add and Get page trace records, that is, the page run tracking records. Easy to Debug.

10, the Tag method: which encapsulates the B method,

11, B Method: Instantiate a behavior class and execute. The load behavior class file uses the Authload method that automatically loads the think class.

12. Add_tag_behavior: Dynamic add behavior expands to a label

13, Compile Method: Project compilation method, in the non-debug mode, the core required to load the file compiled into a file, the main purpose is to simplify the execution process, improve access speed.

14, Array_define: Based on the array to generate constant definitions, mainly used to generate runtime files

*15, Strip_whitespace: Removes whitespace and comments from the code. Using PHP's Tokenizer extension, which is the parser interface of the Zend engine, you can parse the PHP code into a format and save it in an array.

Reference: http://www.xuebuyuan.com/2144644.html

16. Parse_name: string naming style conversion

The following is the new function in version 3.1.3

17. T method: This function is used to get the template file conveniently, usually through the parameter of certain format to get the template file path.

18, I method: Get user input parameters, support filtering and default values. You can specify the input source (the HTTP protocol's get,post,put, the custom source request,session, and so on) when you get the parameters, and three ways to automatically determine the HTTP.

thinkphp function Library notes (common.php_3.1.2 version)

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.