https://www.cnblogs.com/shy-/p/10447827.html
thinkphp3.2 upgrade to thinkphp5.0.24
view file #
Modify the file name #
- The tp3.2.3 \ app \ module \ view folder copy all the folders to tp5 \ app \ module \ view
- Cmd to open a command window, cd to the folder view, perform
dir /b 1.bat
- Use notepad ++ open 1.bat, use regular replacement, it will be
(^.*$)
replacedren $1 \L$0
. - Save 1.bat, double-click execution
Modify the label #
- Regular:
<foreach(.*)>
instead{foreach$1}
</foreach>
Changed{/foreach}
- Regular:
<if (.*)>
instead{if $1}
</if>
Changed{/if}
<else/>
Changed{else/}
- Regular:
<block(.*)">
instead{block$1"}
- Regular:
</block>
instead{/block}
data.info
Changeddata.msg
data.status
Changeddata.code
use Think\Model;
Changeduse think\Db
- Regular:
U\('(.*)/
insteadurl\('\L$1/
{:U('index')}
Changed{:url('index')}
U()
Changedurl()
controller file #
Modify the file name #
- The tp3.2.3 \ app \ module \ view folder copy all the folders to tp5 \ app \ module \ view
- Cmd to open a command window, cd to the folder view, perform
dir /b 1.bat
- Use notepad ++ open 1.bat, use regular replacement, will be
(.*)Controller.class.php
replacedren $0 $1.php
- Save 1.bat, double-click execution
Modify expired function #
$this->display();
Changedreturn view();
- Regular:
\$this->display\('(.*)'\);
instead - Regular:
namespace (Chrent)\\Controller;
insteadnamespace app\\$1\\controller;
- Regular:
class (.*)Controller extends .*Controller
insteadclass $1 extends \\think\\Controller
Helper #
IS_POST、IS_GET等#
Join in the application \ common.php in
Copy
use think\Request; define('IS_GET',Request::instance()->isGet()); define('IS_POST',Request::instance()->isPost()); define('IS_AJAX',Request::instance()->isAjax());
#
Category: backend