当前位置:网站首页>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 .
边栏推荐
- Epoll related references
- opensips与对方tls sip trunk对接注意事项
- 技术干货|昇思MindSpore NLP模型迁移之Roberta ——情感分析任务
- Technical dry goods | Bert model for the migration of mindspore NLP model - text matching task (2): training and evaluation
- Pat class a 1031 Hello world for u
- OSPF experiment
- Mail sending of vertx
- Traversal in Lucene
- C2 several methods of merging VCF files
- Go language foundation ----- 08 ----- interface
猜你喜欢
Screenshot tool snipaste
Technical dry goods | thinking about the unification of dynamic and static diagrams of AI framework
Harmonyos third training notes
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
【LeetCode】2. Valid parentheses · valid parentheses
Technical dry goods | hundred lines of code to write Bert, Shengsi mindspire ability reward
Pat class a 1031 Hello world for u
在浏览器输入url后执行什么
HDMI2.1与HDMI2.0的区别以及转换PD信号。
Project experience sharing: realize an IR Fusion optimization pass of Shengsi mindspire layer
随机推荐
【MySQL 12】MySQL 8.0.18 重新初始化
Go language foundation ----- 04 ----- closure, array slice, map, package
【LeetCode】2. Valid Parentheses·有效的括号
Technical dry goods | alphafold/ rosettafold open source reproduction (2) - alphafold process analysis and training Construction
Vertx's responsive redis client
Rabbit MQ message sending of vertx
LwIP learning socket (API)
一篇文章让你读懂-曼彻斯特编码
Lucene introduces NFA
Go language foundation ----- 10 ----- string related operations (operation function, string conversion)
The difference between typescript let and VaR
华为交换机基础配置(telnet/ssh登录)
Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
PAT甲级 1030 Travel Plan
Go language foundation ------ 14 ------ gotest
[at] abc 258G - Triangle 三元组可达-暴力
Image recognition and detection -- Notes
Lucene hnsw merge optimization
Collector in ES (percentile / base)
Vertx multi vertical shared data