Source of file CachedImage.php
Size: 0,949 Bytes - Last Modified: 2021-12-24T06:46:47+00:00
/var/www/docs.ssmods.com/process/src/code/CachedImage.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php class CachedImage extends Image { public function RelativeLink() { return $this->getCachedImage(); } public function onBeforeWrite() { parent::onBeforeWrite(); $this->getCachedImage(); } public function getCachedImage() { if ($this->isInDB()) { return SSImageMin::get_cached_image($this->getFullPath()); } else { if (!$this->exists()) return; return SSImageMin::get_cached_image(Director::baseFolder() . '/' . $this->fileName); } } /** * Gets the absolute URL accessible through the web. * * @uses Director::absoluteBaseURL() * @return string */ public function getAbsoluteURL() { return Director::absoluteBaseURL() . $this->RelativeLink(); } /** * Gets the relative URL accessible through the web. * * @uses Director::baseURL() * @return string */ public function getURL() { return Director::baseURL() . $this->RelativeLink(); } } |