[英]OroPlatform: Custom HTML column on grid
我正在嘗試為自定義實體網格構建自定義 html 列。 我在 Oro Platform Core 中搜索以找到datagrids.yml
的正確條目
columns:
id:
label: ID
frontend_type: integer
name:
label: app.vehicule_type.fields.name
logo:
label: app.vehicule_type.fields.logo
type: twig
frontend_type: html
template: BaltimoreAppBundle:Attachment:Datagrid/Property/image.html.twig
BaltimoreAppBundle
是我的包名稱和image.html.twig
是自定義模板文件。
OroPlatform/Symfony 無法理解我的包別名BaltimoreAppBundle
,所以我遇到了錯誤。
知道為什么我的別名不起作用嗎?
謝謝。
首先,通過運行確保捆綁包在 symfony kernel 注冊:
php bin/console debug:container --parameter=kernel.bundles --format=json
output 數組中的鍵是應該用於模板路徑的包名稱。 如果不是,請遵循Bundle Creation Guide 。
然后確保您引用的模板的路徑是正確的。 對於您使用的那個,在加載的 BaltimoreAppBundle 包中,您應該具有模板文件路徑: Resources/views/Attachment/Datagrid/Property/image.html.twig
。
如果沒有幫助,請使用rm -rf var/cache/*
刪除應用程序緩存,然后使用php bin/console cache:warmup
手動重新生成應用程序緩存。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.