/** * @inheritdoc */ public function init() { if ($this->url === null) { throw new InvalidConfigException('The "url" attribute must be set.'); } else { $this->url = rtrim($this->url, '/') . '/'; } if ($this->path === null) { throw new InvalidConfigException('The "path" attribute must be set.'); } else { $this->path = rtrim(Yii::getAlias($this->path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; if (!FileHelper::createDirectory($this->path)) { throw new InvalidCallException("Directory specified in 'path' attribute doesn't exist or cannot be created."); } } if ($this->uploadOnlyImage !== true) { $this->_validator = 'file'; } Widget::registerTranslations(); }
/** * @inheritdoc */ public function init() { if ($this->storage === null) { throw new InvalidConfigException('The "storage" attribute must be set.'); } if ($this->uploadOnlyImage !== true) { $this->_validator = 'file'; } Widget::registerTranslations(); }