0

我安装了 LiipImagineBundle,看起来包安装正确。在我的模板中,我添加了以下行:

<img src="{{ asset('bundles/codecatsfront/images/python-bg.png') | imagine_filter('my_thumb') }}" alt="...">

但此网址存在服务器错误: http://pc.t/app_dev.php/media/cache/my_thumb/bundles/codecatsfront/images/python-bg.png

我的 python-bg.png 是链接到 web/codecatsfront/images 的 src/CodeCats/FrontBundle/Resources/public/images/。

我也试过命令:

app/console liip:imagine:cache:resolve php-bg.png

它有效,我对此捆绑包的附加配置:

liip_imagine:
    resolvers:
       default:
          web_path: ~

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

1 回答 1

1

你应该摆脱“asset()”函数。

<img src="{{ 'bundles/codecatsfront/images/python-bg.png' | imagine_filter('my_thumb') }}" alt="...">

它解决了吗?

于 2014-07-02T13:18:48.900 回答