8000 Merge branch '2.7' into 2.8 · symfony/symfony-docs@c56d5d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit c56d5d8

Browse files
committed
Merge branch '2.7' into 2.8
2 parents 4a15c8d + 73c1711 commit c56d5d8

File tree

7 files changed

+22
-46
lines changed

7 files changed

+22
-46
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

controller.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ abstraction around the HTTP response - the text-based message filled with
495495
headers and content that's sent back to the client::
496496

497497
use Symfony\Component\HttpFoundation\Response;
498-
use Symfony\Component\HttpFoundation\JsonResponse;
499498

500499
// create a simple Response with a 200 status code (the default)
501500
$response = new Response('Hello '.$name, Response::HTTP_OK);

http_cache/varnish.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ header:
3232
.. code-block:: varnish4
3333
3434
sub vcl_recv {
35-
remove req.http.Forwarded;
35+
unset req.http.Forwarded;
3636
}
3737
3838
If you do not have access to your Varnish configuration, you can instead

logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,5 @@ Learn more
327327

328328
.. _Monolog: https://github.com/Seldaek/monolog
329329
.. _LoggerInterface: https://github.com/php-fig/log/blob/master/Psr/Log/LoggerInterface.php
330-
.. _`logrotate`: https://fedorahosted.org/logrotate/
330+
.. _`logrotate`: https://github.com/logrotate/logrotate
331331
.. _`Monolog Configuration`: https://github.com/symfony/monolog-bundle/blob/master/DependencyInjection/Configuration.php#L25

reference/configuration/twig.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TwigBundle Configuration ("twig")
6565
6666
<twig:config
6767
auto-reload="%kernel.debug%"
68-
autoescape="true"
68+
autoescape="filename"
6969
base-template-class="Twig_Template"
7070
cache="%kernel.cache_dir%/twig"
7171
charset="%kernel.charset%"
@@ -96,7 +96,7 @@ TwigBundle Configuration ("twig")
9696
'pi' => 3.14,
9797
),
9898
'auto_reload' => '%kernel.debug%',
99-
'autoescape' => true,
99+
'autoescape' => 'filename',
100100
'base_template_class' => 'Twig_Template',
101101
'cache' => '%kernel.cache_dir%/twig',
102102
'charset' => '%kernel.charset%',
@@ -132,8 +132,7 @@ autoescape
132132

133133
**type**: ``boolean`` or ``string`` **default**: ``'filename'``
134134

135-
If set to ``true``, all template contents are escaped for HTML. If set to
136-
``false``, automatic escaping is disabled (you can still escape each content
135+
If set to ``false``, automatic escaping is disabled (you can still escape each content
137136
individually in the templates).
138137

139138
.. caution::

service_container/lazy_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ You can mark the service as ``lazy`` by manipulating its definition:
7878
7979
Once you inject the service into another service, a virtual `proxy`_ with the
8080
same signature of the class representing the service should be injected. The
81-
same happends when calling ``Container::get()`` directly.
81+
same happens when calling ``Container::get()`` directly.
8282

8383
The actual class will be instantiated as soon as you try to interact with the
8484
service (e.g. call one of its methods).

templating/global_variables.rst

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,4 @@ This should feel familiar, as it's the same syntax you use in service configurat
124124
'globals' => array(
125125
'user_management' => '@app.user_management',
126126
),
127-
));
128-
129-
Using a Twig Extension
130-
----------------------
131-
132-
If the global variable you want to set is more complicated - say an object -
133-
then you won't be able to use the above method. Instead, you'll need to create
134-
a :ref:`Twig Extension <reference-dic-tags-twig-extension>` and return the
135-
global variable as one of the entries in the ``getGlobals`` method.
127+
));

0 commit comments

Comments
 (0)
0