예제 #1
0
 public function actionAvatar()
 {
     $profile = $this->findProfile();
     $avatars = Avatar::find()->all();
     if ($profile->load(Yii::$app->request->post()) && $profile->save()) {
         Yii::$app->session->setFlash('success', 'Аватар успешно изменен');
         return $this->redirect(['index']);
     }
     return $this->render('avatar', ['current' => $profile, 'avatars' => $avatars]);
 }
예제 #2
0
 /**
  * Lists all Avatar models.
  * @return mixed
  */
 public function actionIndex()
 {
     //$searchModel = new AvatarSearch();
     $dataProvider = new ActiveDataProvider(['query' => Avatar::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }