/** * {@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; }
/** * {@inheritDoc} */ public function getUrl(MediaInterface $media, VariantInterface $variant, $options = array()) { return $this->baseUrl . $variant->getFilename(); }