/** * @inheritdoc */ public function init() { /** * @var Module $m */ $m = Yii::$app->getModule('user'); if (!$m->getRegistrationSetting('randomUsernames', $this->userType)) { $this->attributes['username'] = ['type' => Form::INPUT_TEXT, 'options' => ['autocomplete' => 'new-username']]; } if (!$m->getRegistrationSetting('randomPasswords', $this->userType)) { $password = ['type' => Form::INPUT_PASSWORD]; if (in_array(Module::SCN_REGISTER, $m->passwordSettings['strengthMeter'])) { $password = ['type' => Form::INPUT_WIDGET, 'widgetClass' => PasswordInput::classname(), 'options' => ['options' => ['placeholder' => Yii::t('user', 'Password'), 'autocomplete' => 'off']]]; } $this->attributes['password'] = $password; } $this->attributes['email'] = ['type' => Form::INPUT_TEXT]; $captcha = ArrayHelper::getValue($m->registrationSettings, 'captcha', false); if ($captcha !== false && is_array($captcha)) { $this->attributes['captcha'] = ['type' => Form::INPUT_WIDGET, 'widgetClass' => Captcha::classname(), 'options' => $captcha['widget']]; } parent::init(); unset($this->attributes['rememberMe']); $this->leftFooter = $m->button(Module::BTN_HOME) . $m->button(Module::BTN_ALREADY_REGISTERED); $this->rightFooter = $m->button(Module::BTN_RESET_FORM) . ' ' . $m->button(Module::BTN_REGISTER); }