public function buildForm(FormBuilder $builder, array $options) { $builder->add('fieldName', 'text', array('label' => 'field.fieldname', 'required' => true))->add('fieldType', 'choice', array('label' => 'field.fieldtype', 'choices' => Field::getFieldTypes(), 'required' => true, 'error_bubbling' => true))->add('fragment', 'choice', array('label' => 'field.fragment', 'choices' => Field::getFragmentTypes(), 'multiple' => false, 'required' => true, 'empty_data' => null, 'error_bubbling' => true))->add('length', 'number', array('label' => 'field.length', 'required' => false, 'error_bubbling' => true))->add('search', 'checkbox', array('label' => 'field.search', 'required' => false, 'error_bubbling' => true))->add('required', 'checkbox', array('label' => 'field.required', 'required' => false, 'error_bubbling' => true))->add('bundleName', 'text', array('label' => 'field.bundlename', 'required' => false, 'error_bubbling' => true))->add('entityName', 'text', array('label' => 'field.enittyname', 'required' => false, 'error_bubbling' => true))->add('relationType', 'choice', array('label' => 'field.relationtype', 'choices' => Field::getRelationTypes(), 'multiple' => false, 'required' => false, 'empty_data' => null, 'error_bubbling' => true))->add('propertyName', 'text', array('label' => 'field.propertyname', 'required' => false, 'error_bubbling' => true))->add('collectionItem', 'textarea', array('label' => 'field.collectionitem', 'required' => false, 'error_bubbling' => true))->add('id', 'hidden', array('label' => 'field.id', 'property_path' => FALSE)); }
public function buildForm(FormBuilder $builder, array $options) { $subscriber = new EntityNameFieldSubscriber($builder->getFormFactory()); $builder->addEventSubscriber($subscriber); $builder->add('fieldName', 'text', array('attr' => array('style' => 'width:120px;margin:0px;'), 'required' => true))->add('fieldType', 'choice', array('attr' => array('style' => 'width:120px;margin:0px;', 'class' => 'typeClass'), 'choices' => Field::getFieldTypes(), 'required' => true))->add('fragment', 'choice', array('attr' => array('style' => 'width:120px;margin:0px;', 'class' => 'fragmentClass'), 'choices' => Field::getFragmentTypes(), 'multiple' => false, 'required' => false, 'empty_data' => null))->add('length', 'number', array('attr' => array('style' => 'width:30px;margin:0px;'), 'required' => false))->add('search', 'checkbox', array('attr' => array('style' => 'margin:0px;'), 'required' => false))->add('required', 'checkbox', array('attr' => array('style' => 'margin:0px;'), 'required' => false))->add('bundleName', 'choice', array('attr' => array('style' => 'width:120px;margin:0px;', 'class' => 'bundleClass'), 'choices' => $this->bundles, 'required' => false))->add('entityName', 'choice', array('attr' => array('style' => 'width:120px;margin:0px;', 'class' => 'entityClass'), 'required' => false))->add('relationType', 'choice', array('attr' => array('style' => 'width:100px;margin:0px;', 'class' => 'relationClass'), 'choices' => Field::getRelationTypes(), 'multiple' => false, 'required' => false, 'empty_data' => null))->add('propertyName', 'choice', array('attr' => array('style' => 'width:120px;margin:0px;', 'class' => 'propertyClass'), 'required' => false))->add('collectionItem', 'textarea', array('attr' => array('style' => 'width:300px;margin:0px;display:none;'), 'required' => false))->add('id', 'hidden', array('attr' => array('style' => 'width:30px;margin:0px'), 'property_path' => false)); }