public function actionIndex($count = DEFAULT_PAGE_SIZE)
 {
     if (Yii::$app->request->isAjax) {
         Yii::$app->controller->module->layout = false;
     }
     $where_clause = null;
     if (isset(\Yii::$app->controller->searchFields)) {
         $argument_data = null;
         if (Yii::$app->request->isAjax) {
             $argument_data = $_REQUEST;
         }
         $where_clause = \vendor\codefire\cfusermgmt\models\Behavior\searchBehavior::search_behavior($argument_data);
     }
     $query = Setting::find()->where($where_clause);
     $activeDataProvider = new \yii\data\ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => $count], 'sort' => ['defaultOrder' => ['id' => SORT_DESC], 'attributes' => ['created', 'id', 'name_public', 'value']]]);
     //  echo "<pre>";print_r($query);die;
     $models = $activeDataProvider->getModels();
     return $this->render('index', ['activeDataProvider' => $activeDataProvider, 'models' => $models]);
 }
 public function actionIndex($count = DEFAULT_PAGE_SIZE)
 {
     if (Yii::$app->request->isAjax) {
         Yii::$app->controller->module->layout = false;
     }
     $where_clause = null;
     if (isset(\Yii::$app->controller->searchFields)) {
         $argument_data = null;
         if (Yii::$app->request->isAjax) {
             $argument_data = $_REQUEST;
         }
         $where_clause = \vendor\codefire\cfusermgmt\models\Behavior\searchBehavior::search_behavior($argument_data);
     }
     $query = RoleAndPermission::find()->onCondition(['type' => TYPE_ROLE])->where($where_clause);
     //Type 1 is for Role (Type 2 is for permission);
     $activeDataProvider = new \yii\data\ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => $count], 'sort' => ['defaultOrder' => ['name' => SORT_DESC], 'attributes' => ['created_at', 'name', 'role_alias', 'allow_registration']]]);
     $models = $activeDataProvider->getModels();
     return $this->render('index', ['activeDataProvider' => $activeDataProvider, 'models' => $models]);
 }
 public function actionOnline($count = DEFAULT_PAGE_SIZE)
 {
     if (Yii::$app->request->isAjax) {
         Yii::$app->controller->module->layout = false;
     }
     $where_clause = null;
     if (isset(\Yii::$app->controller->searchFields)) {
         $argument_data = null;
         if (Yii::$app->request->isAjax) {
             $argument_data = $_REQUEST;
         }
         $where_clause = searchBehavior::search_behavior($argument_data);
     }
     $query = UserActivity::find()->where($where_clause);
     $activeDataProvider = new \yii\data\ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => $count], 'sort' => ['defaultOrder' => ['created' => SORT_DESC], 'attributes' => ['created', 'id', 'name', 'email', 'username']]]);
     $models = $activeDataProvider->getModels();
     return $this->render('online', ['activeDataProvider' => $activeDataProvider, 'models' => $models]);
 }