1. Debug mode
Set the debug Mode section code as follows:
1 <? PHP 2 Define (' App_debug ',TRUE// Open Debug mode constant definition code 3require '/thinkphp frame directory/ Thinkphp.php ';
Close the debug mode code as follows:
Define (' App_debug ',false);
2. Configuration
1 // project configuration file 2 return Array (3 ' configuration parameters ' 4 // More configuration Parameters 5 // ... 6 );
3. Controller
The code is as follows:
1 class extends Action {//The class name here should match the file name 2 Public function index () {3 Echo ' hello,world! ' ; 4 }5 }
4.URL
There are some additions to the small dots:
(1) m parameter indicates module, a operation indicates operation
(2) Under PathInfo mode, the URL is customizable
1 // change the pathinfo parameter delimiter
The following URL access is supported:
http://localhost/app/index.php/module-action-var-value/
(3) Rewrite mode : Add the following code
<ifmodule mod_rewrite.c>%{request_filename}-%{request_filename}-^ (. *) $ index.php/$1 [Qsa,pt,L]</IfModule>
Learn the front end: thinkphp Study notes (2)