Dynamic form modification cookbook: Fix inclusion of code

Includes in a code block don't work, replace them with the actual code
Small fixes in code style
minor #3698 Dynamic form modification cookbook: Fix inclusion of code  (michaelperrin)

This PR was merged into the 2.3 branch.

Discussion
----------

Dynamic form modification cookbook: Fix inclusion of code

Unfortunately, reStructuredText doesn't support inclusion of code inside a code block, resulting to non-interpreted code (the `include` keyword is not displayed) as it happens on http://symfony.com/doc/2.3/cookbook/form/dynamic_form_modification.html .

I tried in many ways to avoid this, but didn't find any nice way. I had to duplicate code instead.

The PR includes a few minor fixes on code style as well.

Commits
-------

1e8b0d4 Small fixes in code style
8093719 Dynamic form modification cookbook: Fix inclusion of code