【发布时间】:2012-05-15 08:39:53
【问题描述】:
我正在使用 Symfony2 和 Sonata Admin Bundle 做一个项目。 如何在 configureShowFields 操作中应用 twig 的过滤器 raw(以显示格式化文本)?
我不会覆盖奏鸣曲模板...
我的 configureShowFields 的代码:
protected function configureShowFields(ShowMapper $showMapper)
{
$showMapper
->add('active')
->add('title')
->add('subtitle') // I need this field with twig RAW filter
->add('description') //I need this field with twig RAW filter
->add('url')
->add('date')
->add('tags')
->add('file');
}
【问题讨论】:
-
查看类似问题SonataAdminBundle custom rendering of text fields in list 以获得简单的解决方案。
标签: symfony twig symfony-sonata admin-generator