예제 #1
0
파일: Image.php 프로젝트: nabble/ajde-core
 public static function fromFingerprint($fingerprint)
 {
     $array = self::decodeFingerprint($fingerprint);
     extract($array);
     $image = new AjdeResourceImage($s);
     $image->setWidth($w);
     $image->setHeight($h);
     $image->setCrop($c);
     return $image;
 }
예제 #2
0
파일: Image.php 프로젝트: nabble/ajde-core
 public static function getImageTag($filename, $width = null, $height = null, $crop = true, $class = '', $lazy = false, $absoluteUrl = false)
 {
     $image = new AjdeResourceImage($filename);
     $image->setWidth($width);
     $image->setHeight($height);
     $image->setCrop($crop);
     $controller = Controller::fromRoute(new Route('_core/component:image'));
     $controller->setImage($image);
     $controller->setExtraClass($class);
     $controller->setLazy($lazy);
     $controller->setAbsoluteUrl($absoluteUrl);
     return $controller->invoke();
 }
예제 #3
0
파일: Embed.php 프로젝트: nabble/ajde-core
 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');
 }