Commit 0361d7a6 authored by Fabien Potencier's avatar Fabien Potencier

minor #1300 Replace binary gender examples with something that is actually...

minor #1300 Replace binary gender examples with something that is actually single-choice (igorwwwwwwwwwwwwwwwwwwww)

This PR was merged into the 1.3 branch.

Discussion
----------

Replace binary gender examples with something that is actually single-choice

In order to include people who do not fit into the gender binary, gender fields really should be a free-form text field. As such, this patch changes the `choices` example to use a billing plan instead.

# References

* http://gender.wikia.com/wiki/Non-binary
* https://en.wikipedia.org/wiki/Genderqueer
* https://modelviewculture.com/pieces/the-argument-for-free-form-input
* https://www.facebook.com/

Commits
-------

0e336e53 Replace binary gender examples with something that is actually single-choice
parents 081257c5 0e336e53
......@@ -91,8 +91,8 @@ example::
$form = $app['form.factory']->createBuilder('form', $data)
->add('name')
->add('email')
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
->add('billing_plan', 'choice', array(
'choices' => array(1 => 'free', 2 => 'small_business', 3 => 'corporate'),
'expanded' => true,
))
->getForm();
......@@ -139,10 +139,10 @@ form by adding constraints on the fields::
->add('email', 'text', array(
'constraints' => new Assert\Email()
))
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
->add('billing_plan', 'choice', array(
'choices' => array(1 => 'free', 2 => 'small_business', 3 => 'corporate'),
'expanded' => true,
'constraints' => new Assert\Choice(array(1, 2)),
'constraints' => new Assert\Choice(array(1, 2, 3)),
))
->getForm();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment