thinkphp在某方法之前与之后执行的方法
来源:原创
时间:2015-08-25
作者:脚本小站
分类:PHP
在thinkphp中有两个方法可以在某个方法之前或之后执行,分别是_before_xxx() 和_after_xxx()两个方法
public function _before_hello(){ //在hello方法之前执行 echo '_before_hello'; } public function _after_hello(){ //在hello方法之后执行 echo '_after_hello'; }