前置操作列表怎么传参数【TP5.1.14版本】

浏览:907 发布日期:2018/06/09 分类:技术分享
前置操作列表怎么传参数:
protected $beforeActionList =['method'=>['opt'=>1]];

修改\thinkphp\Controller.php 下的beforeAction()方法:
//自定义修改添加$opt参数
$opt=[];
if(isset($options['opt'])){
$opt=$options['opt'];
unset($options['opt']);
call_user_func([$this, $method],$opt);
}else{
call_user_func([$this, $method]);
}

最佳答案
评论() 相关
后面还有条评论,点击查看>>