Created
December 21, 2015 17:31
-
-
Save Raistlfiren/7ddc0d10ff17b6ff022e to your computer and use it in GitHub Desktop.
form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
if ($options['required']) { | |
$placeholder = 'test'; | |
} else { | |
$placeholder = 'nope'; | |
} | |
$builder | |
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle')) | |
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle')) | |
->add('firstName', null, array('label' => 'form.firstname')) | |
->add('lastName', null, array('label' => 'form.lastname')) | |
->add('address1', null, array('label' => 'form.fax')) | |
->add('city', null, array('label' => 'form.city')) | |
->add('state', null, array('label' => 'form.state')) | |
->add('zipcode', null, array('label' => 'form.zipcode')) | |
->add('primaryPhone', null, array('label' => 'form.primaryPhone')) | |
->add('altPhone', null, array('label' => 'form.altPhone')) | |
; | |
$builder->addEventSubscriber(new PasswordFieldSubscriber()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very useful when I don't want to create a new form. Thanks guy !