/** * @inheritdoc */ public function scenarios() { $scenarios = parent::scenarios(); $scenarios['ycm-search'] = ['title', 'created_at', 'updated_at']; // Add only attributes that are used in grid view columns return $scenarios; }
/** * Finds the Basic model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * * @param integer $id * @return Basic the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Basic::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }