/** * @inheritdoc */ public function init() { parent::init(); if (!isset($this->containerOptions['id'])) { $this->containerOptions['id'] = $this->options['id'] . '-container'; } }
/** * Initializes the widget. */ public function init() { parent::init(); $this->fieldId = strtolower($this->model->formName() . '-' . $this->attribute); $this->fieldName = $this->model->formName() . '[' . $this->attribute . ']'; $this->hiddenId = strtolower($this->model->formName() . '-' . $this->attribute . '-files'); $this->hiddenName = $this->model->formName() . '[' . $this->attribute . '-files' . ']'; }
/** * @throws Exception */ public function init() { parent::init(); if (!isset($this->uploadUrl)) { throw new Exception('uploadUrl property should be set'); } if (!isset($this->deleteUrl)) { throw new Exception('deleteUrl property should be set'); } }
/** * Initializes the widget. */ public function init() { parent::init(); $this->fieldId = strtolower($this->model->formName() . '-' . $this->attribute); $this->fieldName = $this->model->formName() . '[' . $this->attribute . ']'; if ($this->model) { $model = $this->model; $attribute = $this->attribute; $this->value = $model->{$attribute}; } }
/** * @inheritdoc * @throws \yii\base\InvalidConfigException */ public function init() { parent::init(); $this->registerTranslations(); if (empty($this->url)) { throw new InvalidConfigException('"url" cannot be empty.'); } if (empty($this->formId) && 'ui' == $this->appearance) { throw new InvalidConfigException('"formId" cannot be empty in case of "appearance"=="ui".'); } if (empty($this->mainView)) { $this->mainView = 'ui' == $this->appearance ? 'mainPlusUI' : 'main'; } $this->clientOptions['url'] = $this->options['data-url'] = Url::to($this->url); if (!isset($this->options['multiple'])) { $this->options['multiple'] = true; } }
public function init() { parent::init(); if (empty($this->file)) { $this->file = '/admin/upload'; } if (empty($this->title)) { $this->title = 'File Manager'; } if (empty($this->width)) { $this->width = 700; } if (empty($this->height)) { $this->height = 350; } if (empty($this->resizable)) { $this->resizable = 'yes'; } }
/** * @inheritdoc */ public function init() { parent::init(); if ($this->inline && !isset($this->containerOptions['id'])) { $this->containerOptions['id'] = $this->options['id'] . '-container'; } if ($this->dateFormat === null) { $this->dateFormat = Yii::$app->formatter->dateFormat; } }
/** * Publishes the required assets */ public function init() { parent::init(); }
/** * @inheritdoc * @throws InvalidConfigException */ public function init() { parent::init(); if (!$this->hasModel()) { throw new InvalidConfigException('Params $model and $attribute are required for ' . get_class($this) . '.'); } $model = $this->model; $file = Html::getAttributeValue($model, $this->attribute); if (!$file instanceof File) { throw new InvalidConfigException("Attribute {$this->attribute} of " . get_class($model) . ' must be an instance of ' . File::className() . ' for usage in ' . get_class($this) . '.'); } if (!isset($this->fileInputOptions['id'])) { $this->fileInputOptions['id'] = $this->options['id'] . static::ID_FILE_INPUT_SUFFIX; } if (!isset($this->hiddenInputOptions['id'])) { $this->hiddenInputOptions['id'] = $this->options['id'] . static::ID_HIDDEN_INPUT_SUFFIX; } if (!isset($this->previewContainerOptions['id'])) { $this->previewContainerOptions['id'] = $this->options['id'] . static::ID_PREVIEW_CONTAINER_SUFFIX; } $this->initClientOptions(); }