Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
Added a tip about recaptcha in entity form. As this is a common usage it might help people and avoid issues post.
  • Loading branch information
Molkobain committed Jun 13, 2014
1 parent 9fecbe7 commit 019c761
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Resources/doc/recaptcha/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ public function buildForm(FormBuilder $builder, array $options)
}
```

## Common usages:
### Add captcha in an entity form:

If the captcha field is included in an entity form (eg: User registration), you might have an NoSuchPropertyException. As the captcha is not part of the entity, you have to set the ```mapped``` option to ```false```.

``` php
<?php
// ...
public function buildForm(FormBuilder $builder, array $options)
{
$builder
// ...
->add('captcha', 'genemu_recaptcha', array('mapped' => false));
}
```

## Extra:

[Configuration](https://github.com/genemu/GenemuFormBundle/blob/master/Resources/doc/recaptcha/default.md)

0 comments on commit 019c761

Please sign in to comment.