thinkphp V2.2 Summary of examples of facts not described in the documentation, _php tutorial

Source: Internet
Author: User

thinkphp V2.2 Summary of examples of facts not described in the documentation,


The examples in this article describe those things that are not described in the thinkphp V2.2 documentation. Share to everyone for your reference. The specific analysis is as follows:

Here is a summary of what the documentation does not mention and details: (keep updating later)

1. Set the App_debug to true in the configuration file, when entering debug mode, the page will not display trace information information by default.

Solution: ' Show_page_trace ' =>true add this to it.

The success method in 2.action only needs to deposit two parameters success ($message, $ajax =false), the calling page is not written will also be displayed.

Workaround: To add the following in the configuration file:
' tmpl_action_success ' = ' public:success ' (Error jump: ' tmpl_action_error ' = ' public:success ')

In fact, the default setting in version 2.2 is this:

' Tmpl_action_error ' = Think_path. ' /tpl/dispatch_jump.html '.

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

Workaround: None (no reason found)

4.__root__ in the template input will only be empty characters, after the page jump can not be used __root__ address back to the first page.

Workaround: Modify the __root__ yourself, or add them to all pages, such as:

5. On some servers, the thinkphp framework may have the following issues:

The module could not be loaded, regardless of whether the. htaccess file is set.

The problem is that the GetPathInfo method in thinkphp\lib\think\util\dispatcher.class.php

This method is re-negative to $_server[' path_info '], and the problem comes

$_server[' path_info ']$_server[' orig_path_info ']$_server[' redirect_path_info ']$_server[' REDIRECT_URL ']

The above system variables do not necessarily have, this is the whole egg pain, so getpathinfo will go all the way to determine which to deal with what.

The problem is to determine the $_server["Redirect_url" after the operation, the original code:

$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 '];p arse_str ($parsedUrl [' query '], $GET); $_get = Array_merge ($_get, $GET); Reset ($_get);} else {unset ($_server[' query_string ');} Reset ($_server);}

Red is the cause of the error, change to Request_uri will be normal.

* Note: $_server["Request_uri"] gets the value after http://blog.lpreterite.com, including/

I hope this article is helpful to everyone based on thinkphp PHP program design.

http://www.bkjia.com/PHPjc/1024906.html www.bkjia.com true http://www.bkjia.com/PHPjc/1024906.html techarticle thinkphp V2.2 A summary of those facts that are not described in the documentation, the examples in this article describe those things that are not described in the thinkphp V2.2 documentation. Share to everyone for your reference. Specific analysis ...

  • 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.