/** * @inheritdoc */ public function init() { Widget::registerTranslations(); if ($this->url === null) { throw new InvalidConfigException(Yii::t('cropper', 'MISSING_ATTRIBUTE', ['attribute' => 'url'])); } else { $this->url = rtrim($this->url, '/') . '/'; } if ($this->path === null) { throw new InvalidConfigException(Yii::t('cropper', 'MISSING_ATTRIBUTE', ['attribute' => 'path'])); } else { $this->path = rtrim(Yii::getAlias($this->path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; } }
<div class="panel-heading"><?php echo Yii::t('users', 'PERSONAL_INFO'); ?> </div> <div class="panel-body"> <?php $form = ActiveForm::begin(['id' => 'form-profile']); ?> <?php echo $form->field($model, 'username'); ?> <?php echo $form->field($model, 'sex')->dropDownList(User::getSexArray()); ?> <?php echo $form->field($model, 'photo')->widget(Widget::className(), ['uploadUrl' => Url::toRoute('/user/user/uploadPhoto')]); ?> <div class="form-group"> <?php echo Html::submitButton(Yii::t('users', 'SAVE'), ['class' => 'btn btn-primary', 'name' => 'profile-button']); ?> </div> <?php ActiveForm::end(); ?> </div> </div> </div> <div class="col-xs-12 col-md-5">