Home > php教程 > php手册 > body text

THINKPHP2.0到3.0有哪些改进之处

WBOY
Release: 2016-06-13 09:08:46
Original
959 people have browsed it

THINKPHP2.0到3.0有哪些改进之处

 这篇文章主要介绍了THINKPHP2.0到3.0有哪些改进之处,个人总结了6小点,需要的朋友可以参考下

 

 

1.thinkphp中我们的入口文件写法,可能最后要加一个app::run();

3.0就完全不用了,你会发现不然会出现两次调用2.debug 我们开发的时候在2.0中我们一般都这样写,在conf下边的config.php

但是现在的3.0的申明方式就不一样了,我们就用define(‘APP_DEBUG',true);

这样来申明

3.在模板分配模板的时候,在2.0的时候我们会写这些$this->display(皮肤@模块:方法);

但是我们在3.0就是$this->display(皮肤:模块:方法);

4.在我们调用模型的时候,我们可能会这样$user=D(‘user');这个在2.0是完全可以没问题的,但是

如果你写在3.0上,不好意思你写在UserModel.php模型方法根本调用不出来,这个肿么办呢?

$user->D(‘User');不要忽略大小写

5.3.0的部署目录和2.0的是不同的大家要自己惨老看看

6.3.0的自定义目录或者路径都跟2.0的有区别 大家要对照的手册参考看一下,其实也可以自己写一下

今天就先写这么多,继续更新慢慢来~~

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!