Skip to content

Instantly share code, notes, and snippets.

@johnwards
Created April 27, 2011 14:09
Show Gist options
  • Save johnwards/944304 to your computer and use it in GitHub Desktop.
Save johnwards/944304 to your computer and use it in GitHub Desktop.
<?php
namespace WhiteOctober\FormBuilderBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class FormType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('name')
->add('shortUrl')
->add('welcomeText', 'textarea')
->add('selfRegistration')
;
}
public function getDefaultOptions(array $options)
{
return array(
'virtual' => false,
// Errors in forms bubble by default, so that form errors will
// end up as global errors in the root form
'error_bubbling' => true
);
}
public function getIdentifier()
{
return 'wofb_form';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment