当前位置:网站首页>Differences between tp3.2 and tp5.0
Differences between tp3.2 and tp5.0
2022-07-03 07:45:00 【. Zhou Zhou】
1. Abandonment of single letter functions , Using helper functions
5.0 Helper functions and 3.2 The comparison of the single letter functions in this version is as follows :
| Get and set configuration parameters | Throw exception handling | Debugging time and memory consumption | Get the language variable value | Get input data Supports default values and filtering | Instantiation Model | Instantiate database class | Instantiate controller | Url Generate | Cache management | |
| 3.2 edition | C | E | G | L | I | D | M | A | U | S |
| 5.0 edition | config | exception | debug | lang | input | model | db | controller | url | cache |
2. Method of controller template output
3.2
$this->display()
5.0
return view('index/hello');
or
return $this->fetch('index/hello');
3. Controller naming
The namespace of application class library is unified as app( Modifiable )
The class name of the controller does not come with Controller suffix , Can be configured to turn on controller_suffix Parameter enable controller class suffix
3.2
IndexController.class.php
5.0
Index.php
4. Model
name , The suffix of the model class does not include Model
D('User')->where(['name'=>'thinkphp'])->find();
model('User')->where('name','thinkphp')->find();
5. How to write database operation
M('User')->where(['name'=>'thinkphp'])->find();
db('User')->where('name','thinkphp')->find();
5. Discard system constants
5.0 Obsolete system constants in
REQUEST_METHOD、IS_GET、IS_POST、IS_PUT、IS_DELETE、IS_AJAX、__EXT__、COMMON_MODULE、MODULE_NAME、CONTROLLER_NAME、ACTION_NAME、APP_NAMESPACE、APP_DEBUG、MODULE_PATH etc.
6.getField Method
5.0 Use in value and column Method
value Get the value of a field in a record ;
column Get the value of a column ;
7. Request object and response object
5.0 New request object Request And the response object Response,Request Unified processing of requests and acquisition of request information ,Response Object is responsible for outputting the client or browser response .
边栏推荐
猜你喜欢

Go language foundation ----- 11 ----- regular expression

Reconnaissance et détection d'images - Notes

【LeetCode】4. Best time to buy and sell stock

HCIA notes

一篇文章让你读懂-曼彻斯特编码

Technology dry goods | luxe model for the migration of mindspore NLP model -- reading comprehension task

技术干货|AI框架动静态图统一的思考

Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!
![[coppeliasim4.3] C calls UR5 in the remoteapi control scenario](/img/ca/2f72ea3590c358a6c9884aaa1a1c33.png)
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario

Go language foundation ----- 05 ----- structure
随机推荐
OSPF experiment
Segment read
基于RNA的新型癌症疗法介绍
Redis配置文件
【LeetCode】3. Merge Two Sorted Lists·合并两个有序链表
项目经验分享:基于昇思MindSpore实现手写汉字识别
Pat class a 1030 travel plan
Pat class a 1032 sharing
Mail sending of vertx
HCIA notes
技术干货|昇思MindSpore初级课程上线:从基本概念到实操,1小时上手!
Robots protocol
技术干货|昇思MindSpore可变序列长度的动态Transformer已发布!
Sent by mqtt client server of vertx
Lucene merge document order
Analysis of the ninth Blue Bridge Cup single chip microcomputer provincial competition
Pat grade a 1027 colors in Mars
Technical dry goods | thinking about the unification of dynamic and static diagrams of AI framework
Go language foundation ----- 15 ----- reflection
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer