模板標籤不一樣:
tp5 可在配置檔案中自行定義自己喜歡的標籤
tp5 使用雙標籤 如:
tp3 : <>
tp5 :{}
呼叫資料表方式:
m('user')->where(['name'=>'thinkphp'])->find();(3.2)
db('user')->where('name'=>'thinkphp')->find();(5.0)
m->db
例項化模型的方式:
d('user')->where(['name'=>'thinkphp'])->find();
model('user')->where(['name'=>'thinkphp'])->find();
或者$usermodel =new user();
$usermodel->where(['name'=>'thinkphp'])->find();
d->model
u方法:
u->url
is_get->request::instance()->isget();
is_post->request::instance()->ispost();
i方法i->input(代替);
c方法c->config()
具體檢視助手函式:
tp3 2和tp5 0的區別
1 控制器輸出 5 return this fetch 3.2 this display 3.2 5 g debug 記錄時間和記憶體使用情況 e exception 丟擲異常處理 c config 獲取和設定配置引數 i input 獲取輸入資料 w widget d 例項化model s 快取化...
TP3 2和TP5 0之間的區別
url和路由 5.0的url訪問不再支援普通url模式 路由也不支援正則路由定義,而是全部改為規則路由配合變數規則 正則定義 的方式 主要改進如下 增加路由變數規則 增加組合變數支援 增加資源路由 增加路由分組 增加閉包定義支援 支援url路由規則反解析 請求物件和響應物件 5.0新增了請求物件re...
TP3 2與TP5 0的區別
1.控制器輸出 return this fetch 5 this display 3.2 單字母函式去掉了 如 m d u s c 3.2 5 g debug 記錄時間 微秒 和記憶體使用情況 e exception 丟擲異常處理 c config 獲取和設定配置引數 i input 獲取輸入資料,...