public function getImageUrl(Image $image) { $config = $this->getConfig($image->getConfig()->getKey()); $host = $config['host']; $subDir = $this->getImageSubDir($image); $name = $this->getImageName($image); return sprintf($host, ($subDir ? $subDir . '/' : '') . $name); }