@@ -110,8 +110,11 @@ CSRF Protection
110110
111111Protection against CSRF attacks is built into the Form component, but you need
112112to explicitly enable it or replace it with a custom solution. If you want to
113- use the built-in support, require the Security CSRF component by executing
114- ``composer require symfony/security-csrf ``.
113+ use the built-in support, first install the Security CSRF component:
114+
115+ .. code-block :: bash
116+
117+ $ composer require symfony/security-csrf
115118
116119 The following snippet adds CSRF protection to the form factory::
117120
@@ -157,18 +160,12 @@ to easily render your form as HTML form fields (complete with field values,
157160errors, and labels). If you use `Twig `_ as your template engine, the Form
158161component offers a rich integration.
159162
160- To use the integration, you'll need the ``TwigBridge ``, which provides integration
161- between Twig and several Symfony components. If you're using Composer, you
162- could install the latest 3.x version by adding the following ``require ``
163- line to your ``composer.json `` file:
163+ To use the integration, you'll need the twig bridge, which provides integration
164+ between Twig and several Symfony components:
164165
165- .. code-block :: json
166+ .. code-block :: bash
166167
167- {
168- "require" : {
169- "symfony/twig-bridge" : " ~3.0"
170- }
171- }
168+ $ composer require symfony/twig-bridge
172169
173170 The TwigBridge integration provides you with several :doc: `Twig Functions </reference/forms/twig_reference >`
174171that help you render the HTML widget, label and error for each field
@@ -242,17 +239,11 @@ via your own Twig extension.
242239
243240To use the built-in integration, be sure that your project has Symfony's
244241Translation and :doc: `Config </components/config >` components
245- installed. If you're using Composer, you could get the latest 3.x version
246- of each of these by adding the following to your ``composer.json `` file:
242+ installed:
247243
248- .. code-block :: json
244+ .. code-block :: bash
249245
250- {
251- "require" : {
252- "symfony/translation" : " ~3.0" ,
253- "symfony/config" : " ~3.0"
254- }
255- }
246+ $ composer require symfony/translation symfony/config
256247
257248 Next, add the :class: `Symfony\\ Bridge\\ Twig\\ Extension\\ TranslationExtension `
258249to your ``Twig_Environment `` instance::
@@ -293,16 +284,11 @@ no problem! Simply take the submitted/bound data of your form (which is an
293284array or object) and pass it through your own validation system.
294285
295286To use the integration with Symfony's Validator component, first make sure
296- it's installed in your application. If you're using Composer and want to
297- install the latest 3.x version, add this to your ``composer.json ``:
287+ it's installed in your application:
298288
299- .. code-block :: json
289+ .. code-block :: bash
300290
301- {
302- "require" : {
303- "symfony/validator" : " ~3.0"
304- }
305- }
291+ $ composer require symfony/validator
306292
307293 If you're not familiar with Symfony's Validator component, read more about
308294it: :doc: `/validation `. The Form component comes with a
0 commit comments