1
我使用LiipImagineBundle的Symfony2:LiipImagineBundle - 異常:無法生成名爲路線「_imagine_image_upload_thumbnail」這樣路線的網址不存在
我按照安裝說明,如文檔中
在AppKernel .PHP
new Liip\ImagineBundle\LiipImagineBundle(),
和在routing.yml中
# app/config/routing.yml
_imagine:
resource: .
type: imagine
而且在config.yml
#app/config/config.yml
liip_imagine:
filter_sets:
image_upload_thumbnail:
quality: 85
filters:
thumbnail: { size: [150, 150], mode: outbound }
,並在我的樹枝文件
<img alt="{{ media.title|default('untitled') }}" src="{{ media.getWebPath | imagine_filter('image_upload_thumbnail') }}"/>
我得到這個錯誤
An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "_imagine_image_upload_thumbnail" as such route does not exist.")
我曾嘗試:
- Cache clear
- php app/console router:debug | grep的想象沒有發現
- 路線這麼想的存在,並沒有登記
- 驗證了我有
media/cache
文件夾正確的權限
感謝@nifr的回答,但沒有奏效,問題是路由不存在,甚至沒有運行'php app/console router:debug | grep想象' –
您需要按照說明將其添加到您的routing.yml中:'_imagine: resource:。 類型:想象' –
我和@AhmedSamy有同樣的問題。 –