Skip to content

Commit

Permalink
Fixed the data_class options
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Jul 9, 2011
1 parent c2954ac commit e7b1b5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Form/Type/ProfileFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@

class ProfileFormType extends AbstractType
{
private $class;

/**
* @param string $class The User class name
*/
public function __construct($class)
{
$this->class = $class;
}

public function buildForm(FormBuilder $builder, array $options)
{
$child = $builder->create('user', 'form');
$child = $builder->create('user', 'form', array('data_class' => $this->class));
$this->buildUserForm($child, $options);

$builder
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/change_password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<argument>%fos_user.change_password.form.name%</argument>
<argument />
<argument type="collection">
<argument key="data_class">FOS\UserBundle\Form\ChangePassword</argument>
<argument key="data_class">FOS\UserBundle\Form\Model\ChangePassword</argument>
<argument key="validation_groups">%fos_user.change_password.form.validation_groups%</argument>
</argument>
</service>
Expand Down
3 changes: 2 additions & 1 deletion Resources/config/profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
<argument>%fos_user.profile.form.name%</argument>
<argument />
<argument type="collection">
<argument key="data_class">%fos_user.model.user.class%</argument>
<argument key="data_class">FOS\UserBundle\Form\Model\CheckPassword</argument>
<argument key="validation_groups">%fos_user.profile.form.validation_groups%</argument>
</argument>
</service>

<service id="fos_user.profile.form.type" class="FOS\UserBundle\Form\Type\ProfileFormType">
<argument>%fos_user.model.user.class%</argument>
<tag name="form.type" alias="fos_user_profile" />
</service>

Expand Down
2 changes: 1 addition & 1 deletion Resources/config/resetting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<argument>%fos_user.resetting.form.name%</argument>
<argument />
<argument type="collection">
<argument key="data_class">FOS\UserBundle\Form\ResetPassword</argument>
<argument key="data_class">FOS\UserBundle\Form\Model\ResetPassword</argument>
<argument key="validation_groups">%fos_user.resetting.form.validation_groups%</argument>
</argument>
</service>
Expand Down

0 comments on commit e7b1b5c

Please sign in to comment.