Separate groups:
Apps, each grouping is completely independent, including models, controllers, views, configuration and function files, and so on, can easily implement the grouping of moving and unloading.
The standard stand-alone grouping directory structure is (in the case of a home grouping):
--+ Home Home Group Directory
├-+ Common grouping function directory
├-+ Conf Group configuration directory
├-+ Lang Packet Language Pack directory
├-+ Action Group Action Controller Directory
├-+ Model grouping Models Catalog
├-+ Widget Group Widget directory
├-+ ORG Group Extension Class Library directory
├-+ ... Other Hierarchical catalogs
└-+ TPL Group Template directory
thinkphp Output model and configuration
I. Output of thinkphp 3 (emphasis)
A, through the Echo and other PHP native output mode in the page output
B. Output via Display method
You can use the Assign method to assign variables
C, modify the left and right delimiters
Hugh to modify a configuration item in a configuration file
' Tmpl_l_delim ' = ' <{',//modify left delimiter
' Tmpl_r_delim ' = '}> ',//Modify right delimiter
Ii. model use of thinkphp 3 (emphasis)
You need to manipulate the database in a method by using the new Model (table name)
$m =new Model (' User ');
$arr = $m->select ();
' Db_type ' = ' mysql ',//Set Database type
' db_host ' = ' localhost ',//Set host
' Db_name ' = ' thinkphp ',//Set database name
' Db_user ' + ' root ',//set user name
' Db_pwd ' + ',//Set Password
' Db_port ' = ' 3306 ',//Set port number
' Db_prefix ' = ' tp_ ',//Set table prefix
You can also configure using the DSN method
' Db_dsn ' = ' mysql://root: @localhost: 3306/thinkphp ',//Configure database information using DSN mode
If both methods are present, the DSN takes precedence
There is also a simple and practical way to model
M () is equivalent to the new Model ();
$m =m (' User ');
$arr = $m->select ();
Using instances of the model can manipulate the data, the operation is generally to the database for the deletion of the search curd
Add-C Create $m->add ()
Delete-D delete $m->delete ()
Change-u Update $m->save ()
Check-R Read $m->select ()
Iii. Supplementary (understanding)
A, the template can traverse the array
<{$vo .id}>----<{$vo .username}>-----<{$vo .sex}>
b, we can open the debug function in the Page_trace
1. Turn on the debug function
3. Turn on Debug mode
Define (' App_debug ', true);
2. We need to set the configuration file to open the page trace
' Show_page_trace ' =>true,//open page TRACE
Configuration:
' Url_pathinfo_depr ' = '-',//Modify the delimiter of the URL
' Tmpl_l_delim ' = ' <{',//modify left delimiter
' Tmpl_r_delim ' = '}> ',//Modify right delimiter
' Db_type ' = ' mysql ',//Set Database type
' db_host ' = ' localhost ',//Set host
' Db_name ' = ' thinkphp ',//Set database name
' Db_user ' + ' root ',//set user name
' Db_pwd ' + ',//Set Password
' Db_port ' = ' 3306 ',//Set port number
' Db_prefix ' = ' tp_ ',//Set table prefix
' Db_dsn ' = ' mysql://root: @localhost: 3306/thinkphp ',//Configure database information using DSN mode
' Show_page_trace ' =>true,//open page TRACE http://w2ks.com/
The above describes the [thinkphp] basic guide, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.