示例#1
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     parent::configureFormFields($formMapper);
     $formMapper->remove('firstname');
     $formMapper->remove('lastname');
     $formMapper->with('General')->add('ordering', null, array('required' => false, 'label' => 'Сортировка'))->add('usernameCanonical', null, ['label' => 'Username'])->end()->with('Profile')->add('translations', 'a2lix_translations_gedmo', array('translatable_class' => 'Application\\Bundle\\UserBundle\\Entity\\User', 'fields' => array('firstname' => array('label' => 'Имя', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false))), 'lastname' => array('label' => 'Фамилия', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false))), 'position' => array('label' => 'Должность', 'locale_options' => array('ru' => array('required' => true), 'en' => array('required' => false)))), 'label' => 'Перевод'))->add('avatar', 'file', array('required' => false, 'label' => 'Аватарка'))->add('caricature', 'file', array('required' => false, 'label' => 'Карикатура'))->end()->with('Interests', array('label' => 'Интересы'))->add('interests', 'choice', array('choices' => User::getInterestsList(), 'multiple' => true, 'required' => false, 'label' => 'Интересы'))->add('drink', 'choice', array('choices' => User::getDrinksList(), 'required' => false, 'label' => 'Любимый напиток'))->end();
 }