/** * @inheritdoc */ public function init() { parent::init(); $inputName = explode('_', $this->attribute); if (count($inputName) > 1) { $inputName[0] = $inputName[1]; } $this->inputOptions = array_merge(['data-braintree-name' => Inflector::underScore($inputName[0]), 'autocomplete' => 'off'], $this->inputOptions); }
public function init() { if ($this->readOnly) { $this->inputOptions = array_merge($this->inputOptions, ['name' => false, 'readonly' => true]); $this->radioOptions['disabled'] = true; $this->checkboxOptions['disabled'] = true; $this->selectOptions['disabled'] = true; } parent::init(); }
public function init() { parent::init(); $languages = Yii::$app->yee->languages; $isCurrentLanguage = Yii::$app->language == $this->language; if ($this->language !== NULL && ($this->model->isMultilingual() || $this->multilingual)) { $languageLabel = $languages[$this->language]; $inputLabel = $this->model->getAttributeLabel($this->attribute) . (count($languages) > 1 ? " [{$languageLabel}]" : ''); $this->labelOptions = array_merge($this->labelOptions, ['label' => $inputLabel]); $this->options = array_merge($this->options, ['data-toggle' => 'multilang', 'data-lang' => $this->language, 'class' => $isCurrentLanguage ? 'in' : '']); $langPart = strtolower(str_replace('-', '_', $this->language)); $this->attribute .= $isCurrentLanguage ? '' : '_' . $langPart; } }
public function init() { parent::init(); $this->errorOptions = ArrayHelper::merge($this->errorOptions, ['tag' => 'span']); $this->hintOptions = ArrayHelper::merge($this->hintOptions, ['tag' => 'span']); $hint = $this->model->getAttributeHint($this->attribute); if ($hint) { $this->parts['{hint}'] = Html::tag('span', AmosIcons::show('help-alt'), ['data-toggle' => "tooltip", 'data-placement' => "top", 'title' => html_entity_decode($hint)]); } $error = $this->model->getErrors($this->attribute); if (count($error)) { $this->parts['{error}'] = Html::tag('span', AmosIcons::show('alert'), ['data-toggle' => "tooltip", 'data-placement' => "top", 'title' => html_entity_decode(implode("\n", $error))]); } }
public function init() { if (!array_key_exists('id', $this->inputOptions)) { $this->inputOptions['id'] = $this->form->getId() . '-' . Html::getInputId($this->model, $this->attribute); } if ($this->readOnly) { $this->inputOptions = array_merge($this->inputOptions, ['name' => false, 'readonly' => true]); $this->radioOptions = array_merge($this->radioOptions, ['name' => false, 'readonly' => true, 'disabled' => true]); $this->checkboxOptions = array_merge($this->checkboxOptions, ['name' => false, 'readonly' => true, 'disabled' => true]); $this->dropDownListOptions['disabled'] = true; $this->listBoxOptions['disabled'] = true; $this->enableClientValidation = false; $this->enableAjaxValidation = false; } parent::init(); }
public function init() { parent::init(); }