sonata-admin - SonataAdminBundle 显示带有选项卡的 View

标签 sonata-admin symfony-sonata

我正在使用 SontaAdminBundle,并且我想在选项卡上组织我的显示操作。

protected function configureShowFields(ShowMapper $showMapper)
{
    $showMapper
        ->tab('Infos personnelles')
            ->with('Beneficiary', array('class' => 'col-lg-6'))
                ->add('email')
                ->add('firstname')
                ->add('lastname')
                ->add('civility')
                ->add('dateOfBirth')
                ->add('enabled')
                ->add('address')
            ->end()
        ->end()
        ->tab('projects')
            ->with('projects')
                ->add('title')
                ->add('statusLabel')
            ->end()
        ->end();
}

但是这不起作用。是否还有其他配置要做。

谢谢

最佳答案

您使用的配置很好,您只需将您的sonata版本更新为master即可,检查此提交中的更改:

https://github.com/sonata-project/SonataAdminBundle/commit/fd1a1596f86bfb4afdafe9767efaa4c787bba6a5

更新了 SonataAdminBundle/Resources/views/CRUD/base_show.html.twig 的位置。

希望这有帮助。

关于sonata-admin - SonataAdminBundle 显示带有选项卡的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36294251/

相关文章:

php - SonataAdminBundle 内嵌表单 sonata_admin_type 问题

facebook - Symfony2/Sonata SEO Bundle/og :image

php - SonataAdminBundle : Redirect to list view doesn't save pagination

javascript - 使用 javascript 显示隐藏的选择类型

symfony - 针对自定义表单类型使用 sonata_type_collection 而不是与另一个实体的属性/关系

php - 如何使用奏鸣曲包重命名文件上传

symfony - 在 SonataAdminBundle : what goes where? 中组织文件

php - 在 Sonata Admin Bundle 中使用标签自动完成

mysql - 在sonata管理自定义克隆操作中强制自动递增ID

symfony - 如何过滤用户可以在 Sonata Admin 中看到的实体实例