一、YII2使用当前控制器的方法
1、先在当前控制器定义方法
protected function getAllData($drug_name){
$data = [];
####
return $data;
}2、在控制器中调用
public function actionIndex(){
$name = ‘a‘;
$obj = $this->getAllData($name);
}本文出自 “冰仔” 博客,请务必保留此出处http://hfreeze.blog.51cto.com/1639680/1785770
原文地址:http://hfreeze.blog.51cto.com/1639680/1785770