/**
  * Lists all Notifications models.
  * @return mixed
  */
 public function actionIndex($username = null)
 {
     if (isset($username)) {
         $user = \common\models\User::find()->where(['username' => $username])->one();
     }
     if ($user) {
         $searchModel = new NotificationsSearch();
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'user' => $user]);
     } else {
         $this->redirect(Yii::$app->request->baseUrl . '/providers');
     }
 }
Exemplo n.º 2
0
 /**
  * Lists all Notifications models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new NotificationsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }