当前位置:网站首页>tp3.2和tp5.0的区别
tp3.2和tp5.0的区别
2022-07-03 07:41:00 【.周周】
1.单字母函数的弃用,使用助手函数
5.0助手函数和3.2版本的单字母函数对比如下:
| 获取和设置配置参数 | 抛出异常处理 | 调试时间和内存占用 | 获取语言变量值 | 获取输入数据 支持默认值和过滤 | 实例化Model | 实例化数据库类 | 实例化控制器 | Url生成 | 缓存管理 | |
| 3.2版本 | C | E | G | L | I | D | M | A | U | S |
| 5.0版本 | config | exception | debug | lang | input | model | db | controller | url | cache |
2.控制器模板输出的方法
3.2
$this->display()
5.0
return view('index/hello');
或
return $this->fetch('index/hello');
3.控制器命名
应用类库的命名空间统一为app(可修改)
控制器的类名默认不带Controller后缀,可以配置开启controller_suffix参数启用控制器类后缀
3.2
IndexController.class.php
5.0
Index.php
4.模型
命名,模型类的后缀不带Model
D('User')->where(['name'=>'thinkphp'])->find();
model('User')->where('name','thinkphp')->find();
5.数据库操作写法
M('User')->where(['name'=>'thinkphp'])->find();
db('User')->where('name','thinkphp')->find();
5.废弃系统常量
5.0中废弃的系统常量
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等
6.getField方法
5.0中使用value和column方法
value获取某条记录中某个字段的值;
column获取某列的值;
7.请求对象和响应对象
5.0新增了请求对象Request和响应对象Response,Request统一处理请求和获取请求信息,Response对象负责输出客户端或者浏览器响。
边栏推荐
- Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
- Some basic operations of reflection
- Pgadmin 4 v6.11 release, PostgreSQL open source graphical management tool
- 哪一刻你才发现青春结束了
- Responsive MySQL of vertx
- 【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
- What did the DFS phase do
- 密西根大学张阳教授受聘中国上海交通大学客座教授(图)
- [set theory] order relation (partial order relation | partial order set | example of partial order set)
- GoLang之结构体
猜你喜欢

昇思MindSpore再升级,深度科学计算的极致创新

Traversal in Lucene

Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience

c语言指针的概念

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

Lucene skip table

密西根大学张阳教授受聘中国上海交通大学客座教授(图)

Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition

Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing

【MindSpore论文精讲】AAAI长尾问题中训练技巧的总结
随机推荐
Go language foundation ----- 19 ----- context usage principle, interface, derived context (the multiplexing of select can be better understood here)
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
experiment.........
opensips与对方tls sip trunk对接注意事项
Robots protocol
OSPF protocol summary
Common operations of JSP
Rabbit MQ message sending of vertx
Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition
List exercises after class
Es writing fragment process
输入三次猜一个数字
华为交换机:配置telnet和ssh、web访问
Go language foundation ------ 14 ------ gotest
【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
图像识别与检测--笔记
Common architectures of IO streams
Inverted chain disk storage in Lucene (pfordelta)
项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现