Browse Source

Метод getThumb для упрощенного доступа к сорцам фоток в шаблонизаторе

master
Alexander Demidov 9 years ago
parent
commit
ee07891856
  1. 7
      Image.php

7
Image.php

@ -91,4 +91,11 @@ abstract class Image extends File
return parent::getImageVariant($size, $force_create, $important_create);
}
public function getThumb($width = 0, $height = 0, $crop_method = null) {
if ( $width == 0 && $height == 0 ) {
return \Majestic\Config::get('static_url') . $this->getWebName();
}
return \Majestic\Config::get('static_url') . $this->getVariant($width . 'x' . $height)->getWebName();
}
}
Loading…
Cancel
Save