gpt4 book ai didi

symfony - 奏鸣曲管理包 : strange with labels

转载 作者:行者123 更新时间:2023-12-01 05:29:27 26 4
gpt4 key购买 nike

我已经在 symfony 2.1 上安装了最新的 Sonata 管理包,但遇到了以下问题:
strange labels

配置文件:

services:
app.geo.admin.city:
class: App\GeoBundle\Admin\CityAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: Гео данные, label: Города}
arguments: [null, App\GeoBundle\Entity\City, SonataAdminBundle:CRUD]

管理类:

class CityAdmin extends Admin
{
public function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('name', null, array('required' => true))
->add('code')
->add('region')
->add('crest', 'file', array('required' => false))
->add('banner', 'file', array('required' => false))
->add('sort')
;
}
}

最佳答案

这也是我几周前遇到的一种行为。我认为它在更新后消失了。

不过,向字段显式添加标签通常是有意义的,就像这样

$formMapper
->add('name', null, array('required' => true,
'label' => 'Lastname'
));

关于symfony - 奏鸣曲管理包 : strange with labels,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12132265/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com