Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function getUrl(MediaInterface $media, VariantInterface $variant, $options = array())
 {
     $url = $this->path . $variant->getFilename();
     if (isset($options['absolute']) && $options['absolute']) {
         if (isset($options['domain'])) {
             $domain = $options['domain'];
         } else {
             $domain = $_SERVER['HTTP_HOST'];
         }
         if (isset($options['protocol'])) {
             $protocol = $options['protocol'];
         } else {
             $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http';
         }
         $url = sprintf('%s://%s/%s', $protocol, $domain, ltrim($url, '/'));
     }
     return $url;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function getUrl(MediaInterface $media, VariantInterface $variant, $options = array())
 {
     return $this->baseUrl . $variant->getFilename();
 }