/** * Lists all Log models. * @return mixed */ public function actionIndex() { $searchModel = new LogSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->sort->defaultOrder = ['create_time' => SORT_DESC]; return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * Lists all Log models. * @return mixed * @throws UserException */ public function actionIndex() { $goalId = (int) Yii::$app->request->get('goal_id', 0); if (!$goalId) { throw new UserException('Goal id is not provided'); } $goal = Goal::findOne($goalId); if (!$goal) { throw new UserException("Goal [{$goalId}] not found"); } $searchModel = new LogSearch(['goal_id' => $goalId]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['goal' => $goal, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * Lists all Log models. * @return mixed */ public function actionIndex() { $searchModel = new LogSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }