我只是想让LiipImagineBundle工作。
好吧,到目前为止我只知道:
但在使用之后:
<img src="{{ '/relative/path/to/image.jpg' | imagine_filter('my_thumb') }}" />图像不呈现,路径根本找不到错误。
prod.log说,虽然存在路由_imagine_my_thumb,但它并不存在,因为它使用路由器:调试来显示这两个环境。
发布于 2013-10-24 11:26:32
你知道你应该用你的图像路径代替'/relative/path/to/image.jpg'吗?确保您的文件存在。
一个有用的例子
配置:
liip_imagine:
driver: gd
web_root: %kernel.root_dir%/../web
data_root: %kernel.root_dir%/../app
cache_mkdir_mode: 0777
cache_prefix: /media/cache
cache: web_path
cache_clearer: true
data_loader: filesystem
controller_action: liip_imagine.controller:filterAction
formats: []
filter_sets:
avatar:
filters:
thumbnail: { size: [40, 40], mode: outbound }
profile:
filters:
relative_resize: { widen: 500 }html:
<img src="{{ 'uploads/images/filename.jpg' | imagine_filter('avatar') }}" alt="image">
enter code hererouting.yml:
_imagine:
resource: .
type: imagine备注:我的源文件夹在app文件夹中(参见: data_root)
发布于 2015-11-23 10:44:30
我也遇到了类似的问题,在启用php_fileinfo扩展之后,php.ini呈现开始工作。
https://stackoverflow.com/questions/15851350
复制相似问题