use yeesoft\auth\assets\AvatarAsset; use yeesoft\auth\assets\AvatarUploaderAsset; use yeesoft\auth\widgets\AuthChoice; use yii\bootstrap\ActiveForm; use yii\helpers\Html; use yii\helpers\Url; use yeesoft\helpers\YeeHelper; /** * @var yii\web\View $this * @var yeesoft\auth\models\forms\SetEmailForm $model */ $this->title = Yii::t('yee/auth', 'User Profile'); $this->params['breadcrumbs'][] = $this->title; AvatarUploaderAsset::register($this); AvatarAsset::register($this); $col12 = $this->context->module->gridColumns; $col9 = (int) ($col12 * 3 / 4); $col6 = (int) ($col12 / 2); $col3 = (int) ($col12 / 4); ?> <div class="profile-index"> <div class="row" style="margin-bottom: 20px;"> <div class="col-md-<?php echo $col9; ?> "> <span class="h4"><?php echo $this->title;
public function actionRemoveAvatar() { if (Yii::$app->user->isGuest) { throw new NotFoundHttpException(Yii::t('yii', 'Page not found.')); } Yii::$app->response->format = Response::FORMAT_JSON; try { Yii::$app->user->identity->removeAvatar(); AvatarAsset::register($this->view); return AvatarAsset::getDefaultAvatar('large'); } catch (Exception $exc) { Yii::$app->response->statusCode = 400; return 'Error occured!'; } return; }