index.php//Entry file
Define (' App_debug ', True); Turn on debug mode
Define (' App_path ', './application/'); Defining the App Catalog
Require './thinkphp/thinkphp.php '; Referencing a portal file
Control class (C (Controller))
Files are stored in the home/controller/of the application directory
IndexController.class.php//Using the Hump naming method (Controller name +controller) +. class.php
$this->assign ()//Assign a PHP variable to a template variable
$this->display ()//Specify template output
Template file (V (View))
The file is stored by default in the application directory Home/view/index (Controller name)/index (operation name)
__url__//templates are automatically converted to the current URL
The name attribute of the form must be a field of the database
Model Class (M (model))
FormModel.class.php//Using the Hump naming method (model name +model) +. class.php
Protected $_validate = Array (); Test data
Protected $_auto = Array (); Auto-complete
thinkphp Single Letter function
M ()
$Data = M ($table _name)//Instantiate data Model $table _name as table name
$result = $Data->find (1)//M->find () executes a query to return the results to $result
D ()///when using the D () function, a corresponding model class must be available.
$Data = D ($table _name)//instantiation
$Data->validate ($rules)->create ()//Validation field
$rules = Array (); Rules
thinkphp Study Record