예제 #1
0
 /**
  * Gets the HTML for the image of the data
  * @param mixed $data
  * @return string
  */
 private function getImageHtml($data)
 {
     $modelTable = $this->meta->getModelTable();
     if (!$modelTable->hasDataFormat(DataFormatter::FORMAT_IMAGE)) {
         return '';
     }
     $image = $this->meta->formatData($data, DataFormatter::FORMAT_IMAGE);
     if ($image) {
         $image = new Image($image);
     } else {
         $image = new Image($this->defaultImage);
     }
     $image->setThumbnailer('crop', 50, 50);
     $image->appendToClass(self::STYLE_IMAGE);
     return $image->getHtml();
 }