public function resultAction() { $this->view->setVar('siteTitle', '会员管理'); $this->view->disable(1); $arr = \MagicCategory::find(); // $arr->toArray(); foreach ($arr->toArray() as $key => $val) { echo $val['category_name']; } console($arr->toArray()); }
public function resultAction() { // $result = \MagicCategory::query("select category_name,category_id from magic_category"); $result = \MagicCategory::find()->toArray(); $this->view->setVars(['results' => $result]); }