Skip to content

Commit

Permalink
Small fixes in code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaël Perrin committed Mar 20, 2014
1 parent 8093719 commit 1e8b0d4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cookbook/form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ the event listener might look like the following::
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event){
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
$product = $event->getData();
$form = $event->getForm();

Expand Down Expand Up @@ -147,7 +147,8 @@ the event listener might look like the following::
$builder->addEventListener(FormEvents::PRE_SET_DATA, array($this, 'onPreSetData'));
}

public function onPreSetData(FormEvent $event){
public function onPreSetData(FormEvent $event)
{
// ...
}
}
Expand Down Expand Up @@ -253,7 +254,7 @@ Using an event listener, your form might look like this::
->add('subject', 'text')
->add('body', 'textarea')
;
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event){
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
// ... add a choice list of friends of the current application user
});
}
Expand Down Expand Up @@ -656,7 +657,7 @@ field according to the current selection in the ``sport`` field:
<script>
var $sport = $('#meetup_sport');
// When sport gets selected ...
$sport.change(function(){
$sport.change(function() {
// ... retrieve the corresponding form.
var $form = $(this).closest('form');
// Simulate form data, but only include the selected sport value.
Expand Down Expand Up @@ -691,7 +692,7 @@ field according to the current selection in the ``sport`` field:
<script>
var $sport = $('#meetup_sport');
// When sport gets selected ...
$sport.change(function(){
$sport.change(function() {
// ... retrieve the corresponding form.
var $form = $(this).closest('form');
// Simulate form data, but only include the selected sport value.
Expand Down

0 comments on commit 1e8b0d4

Please sign in to comment.