当前位置:网站首页>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 .
边栏推荐
- 华为S5700交换机初始化和配置telnet,ssh用户方法
- lucene scorer
- 一篇文章让你读懂-曼彻斯特编码
- Sent by mqtt client server of vertx
- 技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
- Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
- [at] abc 258G - Triangle 三元组可达-暴力
- Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
- Segment read
- 华为交换机基础配置(telnet/ssh登录)
猜你喜欢

Application of pigeon nest principle in Lucene minshouldmatchsumscorer

Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!

OSPF experiment

技术干货|昇思MindSpore Lite1.5 特性发布,带来全新端侧AI体验

Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico

Harmonyos third training notes

【MySQL 12】MySQL 8.0.18 重新初始化

技术干货|昇思MindSpore初级课程上线:从基本概念到实操,1小时上手!

【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机

Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing
随机推荐
Hnsw introduction and some reference articles in lucene9
Pat class a 1032 sharing
华为交换机:配置telnet和ssh、web访问
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario
【MySQL 12】MySQL 8.0.18 重新初始化
An overview of IfM Engage
Implementation of breadth first in aggregation in ES
Vertx's responsive redis client
Leetcode 213: looting II
Redis批量启停脚本
Go language foundation ----- 07 ----- method
C2 several methods of merging VCF files
項目經驗分享:實現一個昇思MindSpore 圖層 IR 融合優化 pass
技术干货|昇思MindSpore NLP模型迁移之Bert模型—文本匹配任务(二):训练和评估
Go language foundation ----- 19 ----- context usage principle, interface, derived context (the multiplexing of select can be better understood here)
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
lucene scorer
Technical dry goods | reproduce iccv2021 best paper swing transformer with Shengsi mindspire
华为交换机Console密码重置、设备初始化、默认密码
OSPF experiment