我安装了LiipImagineBundle。
config.yml:
liip_imagine:
filter_sets:
my_thumb:
quality: 75
filters:
thumbnail: { size: [120, 90], mode: outbound }
AppKernel.php:
$bundles = array(
...
new Liip\ImagineBundle\LiipImagineBundle(),
);
当我想使用过滤器时:
<td><img src="{{ asset('images/zestawy/'~entity.zdjecie) | imagine_filter('my_thumb') }}" /></td>
我收到此错误:
An exception has been thrown during the rendering of a template ("Filter not defined: my_thumb")
怎么了?
答案 0 :(得分:1)
您是否在routing.yml中设置了路线?
_imagine:
resource: .
type: imagine
还要确保已清除缓存
php app/console cache:clear --env="dev"
php app/console cache:clear --env="prod"