thinkphp 3 rose thinkphp 5 or higher (data collection)

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, performdir /b 1.bat
  • Use notepad ++ open 1.bat, use regular replacement, it will be (^.*$)replaced ren $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 Changed data.msg
  • data.status Changed data.code
  • use Think\Model; Changed use think\Db
  • Regular:  U\('(.*)/ instead url\('\L$1/
  • {:U('index')} Changed {:url('index')}
  • U() Changed url()

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, performdir /b 1.bat
  • Use notepad ++ open 1.bat, use regular replacement, will be (.*)Controller.class.phpreplacedren $0 $1.php
  • Save 1.bat, double-click execution

Modify expired function #

  • $this->display();Changedreturn view();
  • Regular: \$this->display\('(.*)'\); instead
  • Regular: namespace (Chrent)\\Controller; instead namespace app\\$1\\controller;
  • Regular: class (.*)Controller extends .*Controller instead class $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

Guess you like

Origin blog.csdn.net/james_laughing/article/details/93714049