簡體   English   中英

OroPlatform:網格上的自定義 HTML 列

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM