thinkphp Study Notes (i) thinkphp deployment _php Tutorial

Source: Internet
Author: User
Wampserver has been downloaded and will have time to try to run thinkphp locally.

In the app/lib/action/folder, you can define a controller class for each module, a module can contain multiple action methods, and when requested, resolves the currently requested module and operation from the URL parameter. For example, define the default controller class IndexAciton.class.php:

<?phpclass Indexaction extends action{  ptotect function _initialize () {    header ("content-type:text/html; Charset=utf-8 ");  }  Public Function Index () {    $this->display ();  }  Public Function Imit () {    echo '

SAE Service Simulator Functional Testing (the following services can also be run locally):

"; }}

Accessing http://localhost/, the system accesses the default action (index) of the default module (index). Relative input http://localhost/Index/imit, the system accesses the default module (Index) operation Method (Imit). This URL pattern is pathinfo mode, the default format for thinkphp, and other formats can be set in thinkphp/conf/convention.php, such as normal mode, rewrite mode, and compatibility mode.

Just notes, why can not be set to only their own visible, I write a mess are embarrassed to show people ah.

The rewrite mode of the URL request is the support for adding rewrite rules based on the PathInfo mode, which is the addition of the. htaccess file at the portal file's peers, as in Apache:

 
  
   
  Rewriteengine Onrewritecond%{request_filename}!-drewritecond%{request_filename}!-fRewriteRule ^ (. *) $ index.php/$1 [Qsa,pt,l]
 
  

The only way to do this is to turn on Apache's rewrite function. Locate LoadModule Rewrite_module modules/mod_rewrite.so in the httpd.conf configuration file, remove the previous # and find allowoverride none to allowoverride all. This will work.

http://www.bkjia.com/PHPjc/825530.html www.bkjia.com true http://www.bkjia.com/PHPjc/825530.html techarticle Wampserver has been downloaded and will have time to try to run thinkphp locally. In the app/lib/action/folder, you can define a controller class for each module, and a module can contain multiple ...

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