ThinkPHP learning notes (2) functions of portal files, URL control, and simple use of templates

Source: Internet
Author: User
ThinkPHP learning notes (2) functions of portal files, URL control, and simple use of templates admin. php & lt ;? Phpini_set (& quot; session. save_handler & quot;, & quot; files & quot;); // ThinkPHP core framework file path // second meaning: ThinkPHP study notes (2) functions of entry files, URL control, and simple use of templates

Admin. php

 

IndexAction. php

 Assign ("content", "the monk goes down the hill to save the Zhai, the old monk has an explanation"); $ this-> display (); // 1. specify a new template under the same level // $ this-> display ("newTemplate"); // 2. cross-controller reference template (you can also add group information) // $ this-> display ("Group: User: verify"); // 3. cross-skin reference // $ this-> display ("test @ User: verify"); // 4. full path output (create a public folder in the directory at the same level of the project) // The location where the file is loaded is located in the main portal file. // $ this-> display (". /public/ss.html "); // display parameter // $ this-> display (" location "," UTF-8 "," text/xml ") ;}}?>

Conf/config. php

 'Configuration value' // because the URL is enabled again, whether it is overwritten or not, it can be accessed through the original path. // If you want to enable the rewrite mode, perform the following operations // 1. the query server has enabled the Apache rewrite module // LoadModule rewrite_module modules/mod_rewrite.so // 2. create a new one under the statistics Directory of the master Portal file. htaccess (vi: save. htaccess; notepad :". htaccess ") // If you select mode 2 (rewrite), the server will consume more 'URL _ model' => 1, 'URL _ PATNINFO_MODEL '=> 2, // pathinfo contains two classes // 1 Normal mode: m and a: The order relationship can change // http: // localhost/MyThinkPHP/admin. php/m/index/a/index // pass the value // http: // localhost/MyThinkPHP/admin. php/m/index/a/index/username/zhangsan/password // 2 intelligent identification module operation (intelligent identification is the default mode) // http: // localhost/MyThinkPHP/admin. php/index // pass the value // http: // localhost/MyThinkPHP/admin. php/index/username/zhangsan/password // modify the URL separator // 'URL _ pathinfo_depr' => '-', // modify the left and right delimers of the template 'tmpl _ L_DELIM '=>'
 ', // Enable the debugging mode // 1. simulate a linux system to identify the case. // 2. the case sensitivity of the method name is related to the case sensitivity of the template file 'app _ debug' => true,);?>

. Htaccess

 
  RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
 



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.