buildForm() public method

This method gets called for each type in the hierarchy starting form the top most type. Type extensions can further modify the form.
See also: FormTypeExtensionInterface::buildForm()
public buildForm ( FormBuilder $builder, array $options )
$builder FormBuilder The form builder
$options array The options
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $em = $options['em'];
     $goalTransformer = new GoalToIdTransformer($em);
     $builder->add('start_at', 'date', array("mapped" => false, 'widget' => 'single_text', 'format' => 'yyyy-MM-dd'))->add('title', 'text', array('label' => 'action.daily_action.create_new'))->add('goal', null, array('required' => false))->add('position', null, array('required' => false, 'mapped' => false))->add('add', 'submit', array('label' => 'common.add'));
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('nombrePsaude', 'entity', array('class' => 'EntityBundle:ProblemasSaude', 'multiple' => true, 'required' => false));
     /*->add('paciente_problemassaude', 'collection', array(
           'type'           => new \Paciente_ProblemasSaudeType(),
           //'label'          => 'Orden Responsavels',
           'by_reference'   => false,
           'required'       => false     
           //'prototype_data' => new \EntityBundle\Entity\Orden_Responsavel()
           //'allow_delete'   => true,
           //'allow_add'      => true,
           //'attr'           => array(
            //   'class' => 'row addresses'
           //)
       ));*/
     //->add('nome1', 'text')
     //->add('ocupacao1')
     //->add('telefContato1', 'text',  array('label' => 'Telef de Contato'))
     //->add('email1', 'email');
     /*->add('ordenresponsavels', 'collection', array(
       'type'           => new OneResponsavelType(),
       //'label'          => 'Direcciones',
       'by_reference'   => false,
       'allow_delete'   => true,
       'allow_add'      => true,
       ))*/
     // ->add('nome1', 'text')
     // ->add('ocupacao1')
     // ->add('telefContato1', 'text',  array('label' => 'Telef de Contato'))
     //->add('email1', 'email');
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('firstName');
     $builder->add('lastName');
     $builder->add('nickname');
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('firstName', null, ['description' => 'First name to search for']);
     $builder->add('lastName', null, ['description' => 'Last name to search for']);
     $builder->add('nickname', null, ['description' => 'Nickname to search for']);
 }
 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('roles', 'collection', array('type' => 'choice', 'options' => array('label' => false, 'choices' => array('ROLE_USER' => 'Utilisateur', 'ROLE_MODERATEUR' => 'Moderateur', 'ROLE_ADMIN' => 'Admin'))));
     $builder->add('firstname');
     $builder->add('lastname');
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $availableFormsNames = $this->dynamicFormsChildrenMap->getFormsNamesByGroup($options['group']);
     $this->addAvailableFormsField($builder, $availableFormsNames, $options);
     $this->addAvailableFormsPrototypes($builder, $availableFormsNames);
 }
 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  *
  * @see FormTypeExtensionInterface::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('title', 'text', array('required' => false));
     $builder->add('description', 'wysiwyg', array('required' => false));
     $builder->add('icon', 'choice', array('required' => true, 'choices' => ['code' => 'Code', 'wrench' => 'Wrench']));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     if (!$options['expanded']) {
         throw new LogicException('The option "expanded" cannot the set to false, use the choice field instead.');
     }
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $countries = Intl::getRegionBundle()->getCountryNames();
     // add your custom field
     $builder->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))->add('plainPassword', 'repeated', array('type' => 'password', 'options' => array('translation_domain' => 'FOSUserBundle'), 'first_options' => array('label' => 'form.password'), 'second_options' => array('label' => 'form.password_confirmation'), 'invalid_message' => 'fos_user.password.mismatch'))->add('lastname', 'text')->add('firstname', 'text')->add('image', new AetImageType())->add('pays', 'country', array('expanded' => false, 'multiple' => false))->add('matricule', 'text')->add('whoami', 'textarea', array('required' => false))->add('ville', 'text')->add('code_postale', 'text')->add('telephone', 'text')->add('activite_principale', 'choice', array('choices' => array('Art, Design' => 'Art, Design', 'Audiovisuel - Spectacle' => 'Audiovisuel - Spectacle', 'Audit, gestion' => 'Audit, gestion', 'Automobile' => 'Automobile', 'Banque, assurance' => 'Banque, assurance', 'Bois (filière)' => 'Bois (filière)', 'BTP, architecture' => 'BTP, architecture', 'Chimie, pharmacie' => 'Chimie, pharmacie', 'Commerce, distribution' => 'Commerce, distribution', 'Communication - Marketing, publicité' => 'Communication - Marketing, publicité', 'Construction aéronautique, ferroviaire et navale' => 'Construction aéronautique, ferroviaire et navale', 'Culture - Artisanat d\'art' => 'Culture - Artisanat d\'art', 'Droit, justice' => 'Droit, justice', 'Edition, Journalisme' => 'Edition, Journalisme', 'Électronique' => 'Électronique', 'Énergie' => 'Énergie', 'Enseignement' => 'Enseignement', 'Environnement' => 'Environnement', 'Fonction publique' => 'Fonction publique', 'Hôtellerie, restauration' => 'Hôtellerie, restauration', 'Industrie alimentaire' => 'Industrie alimentaire', 'Informatique, internet et télécom' => 'Informatique, internet et télécom', 'Logistique, transport' => 'Logistique, transport', 'Maintenance, entretien' => 'Maintenance, entretien', 'Mécanique' => 'Mécanique', 'Mode et industrie textile' => 'Mode et industrie textile', 'Recherche' => 'Recherche', 'Santé' => 'Santé', 'Social' => 'Social', 'Sport, loisirs – Tourisme' => 'Sport, loisirs – Tourisme', 'Traduction - interprétariat' => 'Traduction - interprétariat'), 'required' => false, 'mapped' => true))->add('promotion', 'birthday', array('widget' => 'choice', 'years' => range(date('Y') - 110, date('Y')), 'empty_value' => array('year' => '----')));
 }
Beispiel #10
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('Notas', null, array('label' => 'Notas', 'required' => false))->add('Usuario', 'Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType', array('label' => 'Encargado', 'choice_label' => 'NombreVisible', 'attr' => array('class' => 'tapir-input-320'), 'class' => 'Yacare\\BaseBundle\\Entity\\Persona', 'query_builder' => function (\Yacare\BaseBundle\Entity\PersonaRepository $er) {
         return $er->ObtenerQueryBuilderPorRol('ROLE_REQUERIMIENTOS_ENCARGADO');
     }))->add('Requerimiento', 'Tapir\\FormBundle\\Form\\Type\\EntityHiddenType', array('class' => 'Yacare\\RequerimientosBundle\\Entity\\Requerimiento'));
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('username', 'text', ['label' => 'Username', 'required' => true, 'attr' => ['title' => 'Username must be at least 4 characters long and can only contain letters, numbers, and underscores.'], 'constraints' => [new NotBlank()], 'error_type' => 'inline'])->add('plainPassword', 'password', ['label' => 'Password', 'required' => true, 'attr' => ['title' => 'Password must be at least 8 characters long'], 'error_type' => 'inline', 'validation_groups' => ['Registration']])->add('email', 'repeated', ['type' => 'email', 'first_options' => ['label' => 'E-mail'], 'second_options' => ['label' => 'Confirm E-mail'], 'invalid_message' => 'E-mail and Confirm E-mail do not match', 'required' => true, 'constraints' => [new NotBlank(), new Email()], 'error_type' => 'inline']);
     /** @var $property ProfileProperty */
     foreach ($this->propertyRefs as $property) {
         $extra = [];
         if ($property->getName() == 'BirthDay') {
             $extra = ['title' => 'Must be 18 years old or older', 'constraints' => [new Birthday()]];
         }
         $property->createFormElement($builder, false, $extra);
     }
     /*
         ->add('firstName', null, ['label' => 'First Name', 'required' => true, 'mapped' => false])
         ->add('lastName', null, ['label' => 'Last Name', 'required' => true, 'mapped' => false])
         ->add('birthday', 'date', [
             'label' => 'Birthday',
             'years' => range(date('Y') - 10, date('Y') - 100),
             'mapped' => false,
         ])
         ->add('country', 'country', ['preferred_choices' => ['US'], 'mapped' => false])
         ->add('preferredLanguage', 'choice', [
             'label' => 'Language',
             'choices' => ['en' => 'English', 'es' => 'Spanish', 'pt' => 'Portuguese'],
             'required' => true,
             'mapped' => false,
         ])
     ;
     */
 }
Beispiel #12
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('Notas', null, array('label' => 'Notas', 'required' => false))->add('Usuario', 'entity', array('label' => 'Encargado', 'property' => 'NombreVisible', 'class' => 'Yacare\\BaseBundle\\Entity\\Persona', 'query_builder' => function (\Yacare\BaseBundle\Entity\PersonaRepository $er) {
         return $er->ObtenerQueryBuilderPorRol('ROLE_REQUERIMIENTOS_ENCARGADO');
     }))->add('Requerimiento', 'entity_hidden', array('class' => 'Yacare\\RequerimientosBundle\\Entity\\Requerimiento'));
 }
Beispiel #13
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('Nombre', null, array('label' => 'Nombre', 'required' => true))->add('Obs', null, array('label' => 'Obs.', 'required' => false))->add('Encargado', 'entity', array('label' => 'Encargado predet.', 'property' => 'NombreVisible', 'class' => 'Yacare\\BaseBundle\\Entity\\Persona', 'query_builder' => function (\Yacare\BaseBundle\Entity\PersonaRepository $er) {
         return $er->ObtenerQueryBuilderPorRol('ROLE_REQUERIMIENTOS_ENCARGADO');
     }, 'required' => false))->add('PermiteAnonimos', new \Tapir\BaseBundle\Form\Type\SiNoType(), array('label' => 'Admite anónimos', 'required' => true));
 }
 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  *
  * @see FormTypeExtensionInterface::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('url', 'urlchooser', array('required' => true));
     $builder->add('text', 'text', array('required' => true));
     $builder->add('openInNewWindow', 'checkbox', array('required' => false));
 }
Beispiel #15
0
 public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('intTypeOfPerson', 'choice', array('choices' => LenderCreator::GetTypesOfPersonToDropDown(), 'expanded' => true, 'multiple' => false, 'data' => $this->getUser()->getTypeOfPerson()));
     /**
      * LEWA STRONA
      */
     $builder->add('strFirstNameNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Imię', 'data-required' => 'true')));
     $builder->add('strSecondNameNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Drugie imię', 'data-required' => 'false')));
     $builder->add('strLastNameNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Nazwisko', 'data-required' => 'true')));
     $builder->add('strPeselNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'PESEL', 'data-required' => 'true')));
     $builder->add('strIdNumberNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Nr dowodu osobistego', 'data-required' => 'true')));
     $builder->add('strAddressNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Adres zamieszkania', 'data-required' => 'true')));
     $builder->add('strPostCodeNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Kod pocztowy', 'data-required' => 'true')));
     $builder->add('strCityNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Miescowość', 'data-required' => 'true')));
     $builder->add('strPhoneNatural', 'text', array('required' => false, 'attr' => array('placeholder' => 'Telefon', 'data-required' => 'true')));
     /**
      * PRAWA STRONA
      */
     $builder->add('strNameOfCorporationLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Nazwa firmy', 'data-required' => 'true')));
     $builder->add('strRepresentativeLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Reprezentant', 'data-required' => 'true')));
     $builder->add('strKrsOrEdgLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'KRS lub nr wpisu EDG', 'data-required' => 'true')));
     $builder->add('strNipLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'NIP', 'data-required' => 'true')));
     $builder->add('strRegonLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'REGON', 'data-required' => 'true')));
     $builder->add('strAddressLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Adres siedziby', 'data-required' => 'true')));
     $builder->add('strPostCodeLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Kod pocztowy', 'data-required' => 'true')));
     $builder->add('strCityLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Miescowość', 'data-required' => 'true')));
     $builder->add('strPhoneLegal', 'text', array('required' => false, 'attr' => array('placeholder' => 'Telefon', 'data-required' => 'true')));
     $builder->add('username', 'text', array('attr' => array('placeholder' => 'nick'), 'data' => $this->getUser()->getUsername()));
     $builder->add('email', 'text', array('attr' => array('placeholder' => 'e-mail'), 'data' => $this->getUser()->getEmail()));
     $builder->add('password', 'password', array('attr' => array('placeholder' => 'hasło')));
     $this->setDefault($builder);
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('left_number', 'filter_number', $options['left_number_options']);
     $builder->add('right_number', 'filter_number', $options['right_number_options']);
     $builder->setAttribute('filter_value_keys', array('left_number' => $options['left_number_options'], 'right_number' => $options['right_number_options']));
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $em = $options['em'];
     $goalTransformer = new GoalToIdTransformer($em);
     $builder->add($builder->create('goal', 'hidden', array('required' => false))->addModelTransformer($goalTransformer))->add('parent', null, array('required' => false))->add('name', 'text', array('label' => 'action.task.create_new'))->add('add', 'submit', array('label' => 'common.add'));
 }
Beispiel #18
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     // On fait appel à la méthode buildForm du parent, qui va ajouter tous les champs à $builder
     parent::buildForm($builder, $options);
     // On supprime celui qu'on ne veut pas dans le formulaire de modification
     $builder->remove('name');
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     if (true === $options['multiple']) {
         $builder->addViewTransformer(new CollectionToArrayTransformer(), true);
     }
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('Notas', null, array('label' => 'Asunto', 'attr' => array('placeholder' => ''), 'required' => true))->add('Categoria', 'Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType', array('label' => 'Categoría', 'attr' => array('help' => 'Si no sabe cual seleccionar, puede dejarla en blanco para que el administrador asigne una.'), 'class' => 'Yacare\\RequerimientosBundle\\Entity\\Categoria', 'query_builder' => function (\Yacare\RequerimientosBundle\Entity\CategoriaRepository $er) {
         return $er->ObtenerQueryBuilderPublicas();
     }, 'required' => false))->add('UsuarioNombre', null, array('label' => 'Nombre', 'attr' => array('placeholder' => 'Su nombre'), 'required' => false))->add('UsuarioEmail', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\EmailType', array('label' => 'E-mail', 'attr' => array('placeholder' => 'Su dirección de correo electrónico'), 'required' => false))->add('UsuarioDireccion', null, array('label' => 'Dirección', 'attr' => array('placeholder' => 'Su domicilio'), 'required' => false))->add('UsuarioTelefono', null, array('label' => 'Teléfono', 'attr' => array('placeholder' => 'Su número de teléfono'), 'required' => false));
 }
 /**
  * (non-PHPdoc)
  * @see \Symfony\Component\Form\AbstractType::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('title', 'text');
     //$builder->add('category');
     $builder->add('post', $options['post_form'], array('data_class' => $options['post_class'], 'label' => false, 'mapped' => false));
 }
Beispiel #22
0
 public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options)
 {
     $firstDayOfThisMonth = new \DateTime('first day of this month');
     $lastDayOfThisMonth = new \DateTime('last day of this month');
     $builder->add('dateFrom', TextType::class, array('label' => 'Date from', 'required' => false, 'data' => $firstDayOfThisMonth->format('d.m.Y')))->add('dateTo', TextType::class, array('label' => 'Date to', 'required' => false, 'data' => $lastDayOfThisMonth->format('d.m.Y')))->add('reportType', ChoiceType::class, array('label' => 'Report type', 'choices' => ['Staff' => 1, 'Customer' => 2, 'Individual' => 3], 'attr' => array('class' => 'select2'), 'choices_as_values' => true))->add('project', EntityType::class, array('label' => 'Project', 'class' => 'Admin\\FrontendBundle\\Entity\\Project', 'attr' => array('class' => 'select2'), 'required' => false, 'multiple' => true))->add('customer', EntityType::class, array('label' => 'Customer', 'class' => 'Admin\\FrontendBundle\\Entity\\Customer', 'attr' => array('class' => 'select2'), 'required' => false))->add('staff', EntityType::class, array('label' => 'Staff', 'class' => 'Admin\\FrontendBundle\\Entity\\Staff', 'attr' => array('class' => 'select2'), 'required' => false))->add('payType', EntityType::class, array('label' => 'Pay type', 'class' => 'Admin\\FrontendBundle\\Entity\\AttendancePayType', 'attr' => array('class' => 'select2'), 'required' => false))->add('export', SubmitType::class, array('label' => 'Export to CSV', 'attr' => array('class' => 'btn btn-sm btn-info')))->add('submit', SubmitType::class, array('label' => 'Search', 'attr' => array('class' => 'btn btn-sm btn-primary')));
     parent::buildForm($builder, $options);
 }
Beispiel #23
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('name')->add('images', 'text', ['mapped' => false]);
     //->add('isSaved', 'text', ['mapped' => false]));
     //      ->add('slideshowInterval', 'choice', array('choices' => array(10 => 10, 30 => 30, 60 => 60, 120 => 120)));
 }
Beispiel #24
0
 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('nombreImpresion', TextType::class, ['label' => 'Name'])->add('username', TextType::class, ['label' => 'User name'])->add('email', EmailType::class, ['label' => 'Email'])->add('plainPassword', RepeatedType::class, ['type' => PasswordType::class, 'first_options' => ['label' => 'Password'], 'second_options' => ['label' => 'Confirm password'], 'invalid_message' => 'fos_user.password.mismatch']);
     if (!$this->editarCuenta) {
         $builder->add('enabled', CheckboxType::class)->add('roles', ChoiceType::class, ['multiple' => true, 'attr' => ['class' => 'select-chosen'], 'choices' => ['ROLE_SUPER_ADMIN' => 'ROLE_SUPER_ADMIN', 'ROLE_ADMIN' => 'ROLE_ADMIN', 'ROLE_USER' => 'ROLE_USER', 'ROLE_SELLER' => 'ROLE_SELLER']]);
     }
 }
 public function buildForm(FormBuilder $builder, array $options)
 {
     $builder->setAttribute('url', $options['url']);
     $builder->setAttribute('url_params', $options['url_params']);
     $builder->setAttribute('callback', $options['callback']);
     $builder->setAttribute('select_callback', $options['select_callback']);
     parent::buildForm($builder, $options);
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $om = $options['objectManager'];
     $entityClass = $options['class'];
     $modelTransformer = new EntityToIdTransformer($om, $entityClass);
     $builder->addModelTransformer($modelTransformer);
 }
 /**
  * (non-PHPdoc)
  * @see \Symfony\Component\Form\AbstractType::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('name', 'text');
     $builder->add('description', 'textarea');
     $builder->add('enabled', 'checkbox');
     $builder->add('order', 'number');
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     if ($this->url) {
         $listener = new AppFormListener($this->url, $builder);
         $builder->addEventListener(FormEvents::PRE_SUBMIT, array($listener, 'appendValidationTokens'));
     }
 }
Beispiel #29
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('title', 'text', ['required' => false])->add('description', 'textarea', ['required' => false])->add('legal', 'textarea', ['required' => false])->add('mediaExtra', 'textarea', ['required' => false])->add('publicdomain', 'checkbox', ['label' => 'public', 'required' => false]);
     $builder->add('file');
     if ($options['isXmlHttpRequest'] == false) {
         $builder->add('save', 'submit', ['label' => 'Save']);
     }
 }
 /**
  * Builds the form.
  *
  * This method is called for each type in the hierarchy starting form the
  * top most type. Type extensions can further modify the form.
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  *
  * @see FormTypeExtensionInterface::buildForm()
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('media', 'media', array('pattern' => 'KunstmaanMediaBundle_chooser', 'label' => 'mediapagepart.image.choosefile', 'mediatype' => 'image', 'required' => true));
     $builder->add('caption', 'text', array('required' => false));
     $builder->add('altText', 'text', array('required' => false, 'label' => 'mediapagepart.image.alttext'));
     $builder->add('link', 'urlchooser', array('required' => false, 'label' => 'mediapagepart.image.link'));
     $builder->add('openInNewWindow', 'checkbox', array('required' => false, 'label' => 'mediapagepart.image.openinnewwindow'));
 }