2

我安装了 LiipImagineBundle。

配置.yml:

liip_imagine:
    filter_sets:
        my_thumb:
            quality: 75
            filters:
                thumbnail: { size: [120, 90], mode: outbound }

应用内核.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")

怎么了?

4

1 回答 1

1

您是否在您的 routing.yml 中设置了路线?

_imagine:
    resource: .
    type:     imagine

还要确保您已清除缓存

php app/console cache:clear --env="dev"
php app/console cache:clear --env="prod"
于 2013-04-18T08:50:50.260 回答