public function init() { $this->options['placeholder'] = count($this->options['placeholder']) ? array_merge($this->defaultOptions['placeholder'], $this->options['placeholder']) : $this->defaultOptions['placeholder']; $this->options['quality'] = !isset($this->options['quality']) || !is_numeric($this->options['quality']) ? $this->defaultOptions['quality'] : $this->options['quality']; if ($this->options['placeholder']['type'] == Thumbnail::PLACEHOLDER_TYPE_JS) { AssetBundle::register(Yii::$app->getView()); } }
public function init() { if (isset($this->options['placeholder']) && count($this->options['placeholder'])) { $this->options['placeholder'] = array_merge($this->defaultOptions['placeholder'], $this->options['placeholder']); } else { $this->options['placeholder'] = $this->defaultOptions['placeholder']; } $this->options['quality'] = !isset($this->options['quality']) || !is_numeric($this->options['quality']) ? $this->defaultOptions['quality'] : $this->options['quality']; if ($this->options['placeholder']['type'] == Thumbnail::PLACEHOLDER_TYPE_JS) { AssetBundle::register(Yii::$app->getView()); } if (isset($this->options['tinyPng']) && count($this->options['tinyPng'])) { $this->options['tinyPng'] = array_merge($this->defaultOptions['tinyPng'], $this->options['tinyPng']); } else { $this->options['tinyPng'] = $this->defaultOptions['tinyPng']; } if (!is_null($this->options['tinyPng']['apiKey'])) { $this->tiny = new Compressor($this->options['tinyPng']['apiKey']); } }