view文件
修改文件名
- 把tp3.2.3\app\module\view文件夹下所有文件夹拷贝至tp5\app\module\view
- 打开cmd命令窗口,cd至view文件夹下,执行
dir /b 1.bat - 使用notepad++打开1.bat,使用正则替换,将
(^.*$)替换为ren $1 \L$0。 - 保存1.bat,双击执行
修改标签
- 正则:
<foreach(.*)>改为{foreach$1} </foreach>改为{/foreach}- 正则:
<if (.*)>改为{if $1} </if>改为{/if}<else/>改为{else/}- 正则:
<block(.*)">改为{block$1"} - 正则:
</block>改为{/block} data.info改为data.msgdata.status改为data.codeuse Think\Model;改为use think\Db- 正则:
U\('(.*)/改为url\('\L$1/ {:U('index')}改为{:url('index')}U()改为url()
controller文件
修改文件名
- 把tp3.2.3\app\module\view文件夹下所有文件夹拷贝至tp5\app\module\view
- 打开cmd命令窗口,cd至view文件夹下,执行
dir /b 1.bat - 使用notepad++打开1.bat,使用正则替换,将
(.*)Controller.class.php替换为ren $0 $1.php - 保存1.bat,双击执行
修改过期函数
$this->display();改为return view();- 正则:
\$this->display\('(.*)'\);改为 - 正则:
namespace (Chrent)\\Controller;改为namespace app\\$1\\controller; - 正则:
class (.*)Controller extends .*Controller改为class $1 extends \\think\\Controller
助手函数
IS_POST、IS_GET等
在application\common.php中加入
use think\Request;
define('IS_GET',Request::instance()->isGet());
define('IS_POST',Request::instance()->isPost());
define('IS_AJAX',Request::instance()->isAjax());
