A. What is defined in the portal file?
1. Check the PHP Environment: if (Version_compare (php_version, ' 5.3.0 ', ' < ') die (' Require PHP > 5.3.0! ');
2. Open Debug mode suggest the development phase to open the deployment phase note or set to False:define (' App_debug ', True);
3. Define the absolute address of the root directory: define (' Root ', str_replace ("\ \", "/", DirName (__file__)))
4. Define the application directory: define (' App_path ', './application/');
5. Introduction of the thinkphp entry file: Require './thinkphp/thinkphp.php ';
Two. The parameter rules of the U method?
U (' address expression ', [' parameter '],[' pseudo static suffix '],[' Display domain name '])
Address expression:[模块/控制器/操作#锚点@域名]?参数1=值1&参数2=值2...
Three. How to determine the type of request, what are the two common request methods, the parameter rules of the I method?
Is_post; Is_get; Quest_method
I (' variable name ', ' default value '],[' Filter method '],[' extra data source ']) [] The value in [] is an optional value;
Four: The method of success and failure jump and parameter rules?
Success: $this->success ("Prompt for Success", "Jump Address", "time");
Failure: $this->error ("Failed Prompt", "Jump Address", "time");
Five: The URL of the four modes, briefly describe the rules of each type?
1. Normal mode: Http://localhost/?m=home&c=user&a=login&var=value Url_model setting: 0;
2.PATHINFO mode: Http://localhost/index.php/home/user/login?var=value Url_model set: 1;
3.REWRITE mode: Http://localhost/home/user/login/var/value Url_model set: 2;
4. Compatibility mode: Http://localhost/?s=/home-user-login-var-value Url_model setting: 3;
Six: What are the common configuration files for TP? What is the order in which the configuration files are loaded?
1) Custom configuration file (located at thinkphp/conf/convention.php)
Public config file (default is application/common/conf/config.php)
Debug configuration file (in thinkphp/conf/debug.php)
Apply a Debug configuration file (located in application/common/conf/debug.php)
2) Custom configuration, application configuration, mode configuration, Debug configuration, state configuration, module configuration, extended configuration--dynamic configuration
Seven: the template renders the parameter rules of the display method?
Dis Play (' [Template file] ' [, ' character encoding '] [, ' Output type '])
Eight: Common template built-in tags and examples used in the template, cite 5!
<volist name= "list" id= "Data" >{$data [' ID ']}<br/></volist>
<foreach name= "list" item= "VO" >{$vo [' ID ']}</foreach>
<for start= "Start value" end= "End Value" comparison= "step=" Step value "Name=" Loop variable name "></for>
<switch name= "variable" ><case value= "value 1" break= "0 or 1" > Output 1</case><default/> default </switch>
<eq name= "name" value= "value" > Equal <else/> unequal </eq>
<if condition= "($name eq 1) OR ($name gt)" > value3</if>
IX: template contains the parameters of the rules and examples?
Module @ theme/controller/operation
<include file= "Public/menu"/>
10:3 large automatic parameter rules?
protected $_map=Array(' name ' = ' username ',//map the name in the form to the Username field in the data table' Mail ' = ' email ',//map mail from the form to the email field in the datasheet); protected $_validate=Array(Array(' Verify ', ' Require ', ' captcha must! ‘),//verified by default); protected $_auto=Array(Array(' Status ', ' 1 '),//The Status field is set to 1 when added;
11: Describe the entire process code that the upload class invokes in the controller?
Public functionupload () {$upload=New\think\upload ();//instantiating an upload class $upload->maxsize = 3145728;//set attachment upload size $upload->exts =Array(' jpg ', ' gif ', ' PNG ', ' jpeg ');//set attachment upload type $upload->savepath = './public/uploads/';//Set Attachments upload directory//upload file $info = $upload->upload (); if(!$info) {//Upload error message $this->error ($upload-GetError ()); }Else{//Upload Successful $this->success (' Upload success! ‘); }}
thinkphp Simple Knowledge point (i)