Skip to content

Commit

Permalink
Merge pull request #1224 from eroluysal/master
Browse files Browse the repository at this point in the history
added reference type to generate url
  • Loading branch information
dbu authored Sep 16, 2019
2 parents 539b552 + c96ea0f commit 8dcc8c1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Imagine/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ public function getRuntimePath($path, array $runtimeConfig)
* @param string $filter The name of the imagine filter in effect
* @param array $runtimeConfig
* @param string $resolver
* @param int $referenceType The type of reference to be generated (one of the UrlGenerator constants)
*
* @return string
*/
public function generateUrl($path, $filter, array $runtimeConfig = [], $resolver = null)
public function generateUrl($path, $filter, array $runtimeConfig = [], $resolver = null, $referenceType = UrlGeneratorInterface::ABSOLUTE_URL)
{
$params = [
'path' => ltrim($path, '/'),
Expand All @@ -153,12 +154,12 @@ public function generateUrl($path, $filter, array $runtimeConfig = [], $resolver
}

if (empty($runtimeConfig)) {
$filterUrl = $this->router->generate('liip_imagine_filter', $params, UrlGeneratorInterface::ABSOLUTE_URL);
$filterUrl = $this->router->generate('liip_imagine_filter', $params, $referenceType);
} else {
$params['filters'] = $runtimeConfig;
$params['hash'] = $this->signer->sign($path, $runtimeConfig);

$filterUrl = $this->router->generate('liip_imagine_filter_runtime', $params, UrlGeneratorInterface::ABSOLUTE_URL);
$filterUrl = $this->router->generate('liip_imagine_filter_runtime', $params, $referenceType);
}

return $filterUrl;
Expand Down

0 comments on commit 8dcc8c1

Please sign in to comment.