Thinkphp 3.2.3 Release Study notes

Source: Internet
Author: User

1, in the relevant test, you must turn on the debug mode:define (' App_debug ', true); Add in Unique Portal file index.php

2. What is the function of opening debug mode? (closed by default, around thinkphp.php 33 rows)

(1) When the illegal call, there is a detailed error message, easy to debug

(2) App_debug is true and the cache file exists, go to cache file, otherwise load common folder under runtime.php (code below think.php)

(3) Do not produce cache files at the same time App_debug to True will delete Runtime_file (cache) files (runtime.php 126 rows or so).

thinkphp.php file (bottom)

if (! App_debug && Is_file (runtime_file)) {
Deployment mode loads directly into run cache
Echo __file__; G:\wamp\www\orange\ThinkPHP\ThinkPHP.php
Require runtime_file;
}else{
system catalog Definition
Think_path G:\wamp\www\orange\ThinkPHP
Defined (' Think_path ') or define (' Think_path ', DirName (__file__). ' /‘);
When you load a runtime file
Require Think_path. ' Common/runtime.php ';
}

2. URL mode

(1) 0-> Normal mode

(2) 1-> default mode pathinfo mode

(3) 2-> rewrite mode

(4) 3-> compatibility mode

To output the current URL pattern: Echo C (' Url_model ');

To get the current page address: Using the U method

Form:U (' Controller name/method ', array (' ID ' =>x), ' suffix ', ' whether jump ' (true or false), ' localhost ');

For example: U (' Index/index ', array (' ID ' =>1), ' HTML ', ' true ', ' localhost ');

Thinkphp 3.2.3 Release Study notes

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.