public function process() { switch ($this->_attributeParse()) { case 'base64': $image = new AjdeResourceImage($this->attributes['filename']); $image->setWidth(issetor($this->attributes['width'])); $image->setHeight(issetor($this->attributes['height'])); $image->setCrop(String::toBoolean(issetor($this->attributes['crop'], true))); $controller = Controller::fromRoute(new Route('_core/component:imageBase64')); $controller->setImage($image); $controller->setWidth(issetor($this->attributes['width'], null)); $controller->setHeight(issetor($this->attributes['height'], null)); $controller->setExtraClass(issetor($this->attributes['class'], '')); return $controller->invoke(); break; case 'html': return self::getImageTag($this->attributes['filename'], issetor($this->attributes['width']), issetor($this->attributes['height']), String::toBoolean(issetor($this->attributes['crop'], true)), issetor($this->attributes['class'], ''), issetor($this->attributes['lazy'], false), issetor($this->attributes['absoluteUrl'], false)); break; case 'image': return false; break; } // TODO: throw new Exception('Missing required attributes for component call'); }
public function process() { switch ($this->_attributeParse()) { case 'render': $image = new Image($this->attributes['filename']); $image->setWidth($this->attributes['width']); $image->setHeight($this->attributes['height']); $image->setCrop(String::toBoolean($this->attributes['crop'])); $controller = Controller::fromRoute(new Route('_core/component:imageBase64')); $controller->setImage($image); $controller->setWidth(issetor($this->attributes['width'], null)); $controller->setHeight(issetor($this->attributes['height'], null)); $controller->setExtraClass(issetor($this->attributes['class'], '')); return $controller->invoke(); break; } // TODO: throw new Exception('Missing required attributes for component call'); }