/** * Lists all Permission models. * @return mixed */ public function actionIndex() { $result = []; $rows = Permission::findAll(null, 'sort_num asc'); foreach ($rows as $row) { $result[$row->category][] = $row; } return $this->render('index', ['basicsDataProvider' => $this->getDataRrovider($result, Permission::Category_Basic), 'controllersDataProvider' => $this->getDataRrovider($result, Permission::Category_Controller), 'systemsDataProvider' => $this->getDataRrovider($result, Permission::Category_System)]); }
/** * Lists all Permission models. * @return mixed */ public function actionIndex() { $result = []; $rows = Permission::findAll(null, 'sort_num desc'); foreach ($rows as $row) { $result[$row->category][] = $row; } return $this->render('index', ['basicsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_Basic, []), 'key' => 'id']), 'controllersDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_Controller, []), 'key' => 'id']), 'systemsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_System, []), 'key' => 'id'])]); }