for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the `liip/LiipImagineBundle` project.
*
* (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Liip\ImagineBundle\Templating;
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
trait FilterTrait
{
/**
* @var CacheManager
private $cache;
* @param CacheManager $cache
public function __construct(CacheManager $cache)
$this->cache = $cache;
}
* Gets the browser path for the image and filter to apply.
* @param string $path
* @param string $filter
* @param array $config
* @return string
public function filter($path, $filter, array $config = [], $resolver = null)
return $this->cache->getBrowserPath($path, $filter, $config, $resolver);
* {@inheritdoc}
public function getName()
return 'liip_imagine';