Thinkphp v2.2 does not describe thinkphp v2.2 !!!

Source: Internet
Author: User

Thinkphp v2.2 does not describe thinkphp v2.2 !!!

The following is a summary of the content not mentioned and described in this document: (updated continuously in the future)

1. Set app_debug to true in the configuration file. When the debug mode is enabled, the trace information is not displayed on the page by default.

Solution: 'Show _ page_trace '=> true
Add this.

2. The success method in the action only needs to store two parameters success ($ message, $ Ajax = false). The called page is displayed even if it is not written.

Solution: Add 'tmpl _ action_success 'to the configuration file'
=> 'Public: Success '(error jump: 'tmpl _ action_error' => 'public: Success ')

In fact, in version 2.2, the default setting is 'tmpl _ action_error '=> think_path.'/TPL/dispatch_jump.html '.

3. Use the normal label load template engine to directly ignore it.

Solution: none (no reason is found)

4. _ root _ the input in the template will only be empty characters. After the page jumps, the _ root _ address cannot be used to return to the homepage.

Solution: Modify _ root __by yourself, or add <Base
Href = 'HTTP: // root directory address for Website access '/>, for example: <base href = 'HTTP: // winesbox.com'/>

5. The thinkphp framework on some servers may encounter the following problems:

The module cannot be loaded. In this case, whether the. htaccess file is set is irrelevant.

The problem lies in the getpathinfo method in thinkphp \ Lib \ think \ util \ dispatcher. Class. php.

This method returns a negative value to $ _ server ['path _ info'], and the problem arises.

$ _ Server ['path _ info']
$ _ Server ['orig _ path_info ']
$ _ Server ['redirect _ path_info ']
$ _ Server ["redirect_url"]

The above system variables may not exist. This is a pain point, so getpathinfo will always determine which one is going to do something.

The cause of the error is that the operation is performed after $ _ server ["redirect_url"]. The original code is as follows:

$ Path
= $ _ Server ["redirect_uri"];
If (empty ($ _ server ['query _ string']) | $ _ server ['query _ string'] == _ server ["redirect_query_string"]) {
$ Parsedurl = parse_url ($ _ server ["request_url"]);
If (! Empty ($ parsedurl ['query']) {
$ _ Server ['query _ string'] = $ parsedurl ['query'];
Parse_str ($ parsedurl ['query'], $ get );
$ _ Get = array_merge ($ _ Get, $ get );
Reset ($ _ Get );
} Else {
Unset ($ _ server ['query _ string']);
}
Reset ($ _ server );
}

The reason for the error is marked in red. changing it to request_uri will be normal.

* Note: $ _ server ["request_uri"] gets the value after the http://blog.lpreterite.com, including/

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.