Skip to content

Commit

Permalink
[Forms/overview] added namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierbriand authored and fabpot committed Nov 22, 2010
1 parent e70a917 commit cb08d7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions guides/forms/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ We can use a field group to show fields for the customer and the nested
address at the same time::

# src/Application/HelloBundle/Controller/HelloController.php

use Symfony\Component\Form\FieldGroup;

public function signupAction()
{
$customer = new Customer();
Expand All @@ -213,6 +216,8 @@ The ``RepeatedField`` is an extended field group that allows you to output a
field twice. The repeated field will only validate if the user enters the same
value in both fields::

use Symfony\Component\Form\RepeatedField;

$form->add(new RepeatedField(new TextField('email')));

This is a very useful field for querying email addresses or passwords!
Expand All @@ -233,6 +238,8 @@ will extend the ``Customer`` class to store three email addresses::

We will now add a ``CollectionField`` to manipulate these addresses::

use Symfony\Component\Form\CollectionField;

$form->add(new CollectionField(new TextField('emails')));

If you set the option "modifiable" to ``true``, you can even add or remove
Expand Down

0 comments on commit cb08d7d

Please sign in to comment.