Skip to content

Commit 8e4410f

Browse files
committed
minor #6855 [Form] Use composer require instead of modifying composer.json (wouterj)
This PR was merged into the 2.7 branch. Discussion ---------- [Form] Use composer require instead of modifying composer.json Replaces #6639 This gets rid of some versions we have to tweak on each branch. Commits ------- fc920d6 Use composer require instead of modifying composer.json
2 parents 7541935 + fc920d6 commit 8e4410f

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

components/form.rst

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ CSRF Protection
113113

114114
Protection against CSRF attacks is built into the Form component, but you need
115115
to explicitly enable it or replace it with a custom solution. If you want to
116-
use the built-in support, require the Security CSRF component by executing
117-
``composer require symfony/security-csrf``.
116+
use the built-in support, first install the Security CSRF component:
117+
118+
.. code-block:: bash
119+
120+
$ composer require symfony/security-csrf
118121
119122
The following snippet adds CSRF protection to the form factory::
120123

@@ -160,18 +163,12 @@ to easily render your form as HTML form fields (complete with field values,
160163
errors, and labels). If you use `Twig`_ as your template engine, the Form
161164
component offers a rich integration.
162165

163-
To use the integration, you'll need the ``TwigBridge``, which provides integration
164-
between Twig and several Symfony components. If you're using Composer, you
165-
could install the latest 2.7 version by adding the following ``require``
166-
line to your ``composer.json`` file:
166+
To use the integration, you'll need the twig bridge, which provides integration
167+
between Twig and several Symfony components:
167168

168-
.. code-block:: json
169+
.. code-block:: bash
169170
170-
{
171-
"require": {
172-
"symfony/twig-bridge": "2.7.*"
173-
}
174-
}
171+
$ composer require symfony/twig-bridge
175172
176173
The TwigBridge integration provides you with several :doc:`Twig Functions </reference/forms/twig_reference>`
177174
that help you render the HTML widget, label and error for each field
@@ -245,17 +242,11 @@ via your own Twig extension.
245242

246243
To use the built-in integration, be sure that your project has Symfony's
247244
Translation and :doc:`Config </components/config>` components
248-
installed. If you're using Composer, you could get the latest 2.7 version
249-
of each of these by adding the following to your ``composer.json`` file:
245+
installed:
250246

251-
.. code-block:: json
247+
.. code-block:: bash
252248
253-
{
254-
"require": {
255-
"symfony/translation": "2.7.*",
256-
"symfony/config": "2.7.*"
257-
}
258-
}
249+
$ composer require symfony/translation symfony/config
259250
260251
Next, add the :class:`Symfony\\Bridge\\Twig\\Extension\\TranslationExtension`
261252
to your ``Twig_Environment`` instance::
@@ -296,16 +287,11 @@ no problem! Simply take the submitted/bound data of your form (which is an
296287
array or object) and pass it through your own validation system.
297288

298289
To use the integration with Symfony's Validator component, first make sure
299-
it's installed in your application. If you're using Composer and want to
300-
install the latest 2.7 version, add this to your ``composer.json``:
290+
it's installed in your application:
301291

302-
.. code-block:: json
292+
.. code-block:: bash
303293
304-
{
305-
"require": {
306-
"symfony/validator": "2.7.*"
307-
}
308-
}
294+
$ composer require symfony/validator
309295
310296
If you're not familiar with Symfony's Validator component, read more about
311297
it: :doc:`/validation`. The Form component comes with a

0 commit comments

Comments
 (0)