【发布时间】:2015-09-20 00:23:21
【问题描述】:
在索纳塔的AdminBundle\Mapper\BaseGroupedMapper.php,我看到了一个代码示例:
public function with($name, array $options = array())
{
/*
* The current implementation should work with the following workflow:
*
* $formMapper
* ->with('group1')
* ->add('username')
* ->add('password')
* ->end()
* ->with('tab1', array('tab' => true))
* ->with('group1')
* ->add('username')
* ->add('password')
* ->end()
* ->with('group2', array('collapsed' => true))
* ->add('enabled')
* ->add('createdAt')
* ->end()
* ->end();
*
*/
很遗憾,如果我先添加组然后添加选项卡,则会出现错误。我希望我的表单有一个主要的简单表单(名字等...),然后在它下面的选项卡上逐个选项卡列出实体关系表单(onetomany...)以保持它的清洁。不幸的是,我收到了这个错误:
New tab was added automatically when you have added field or group. You should close current tab before adding new one OR add tabs before adding groups and fields.
有谁知道如何进行这项工作?或者这是两个分开的例子?如果可能的话,我希望避免使用纯选项卡,因此无法让我的表单的一部分始终可见。
【问题讨论】:
标签: symfony sonata-admin sonata