我在 symfony 2.1 上安装了最新的 Sonata 管理包,但遇到了以下问题:
配置.yml:
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')
;
}
}