8000 Merge branch '3.1' · symfony/symfony-docs@da458d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit da458d5

Browse files
committed
Merge branch '3.1'
2 parents 42d7888 + 79bd63c commit da458d5

File tree

9 files changed

+25
-48
lines changed

9 files changed

+25
-48
lines changed

components/cache/cache_pools.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ application as if they were Symfony Cache adapters::
153153
use Doctrine\Common\Cache\SQLite3Cache;
154154
use Symfony\Component\Cache\Adapter\DoctrineAdapter;
155155

156-
$doctrineCache = new SQLite3Cache(__DIR__.'/cache/data.sqlite');
156+
$sqliteDatabase = new \SQLite3(__DIR__.'/cache/data.sqlite');
157+
$doctrineCache = new SQLite3Cache($sqliteDatabase, 'tableName');
157158
$symfonyCache = new DoctrineAdapter($doctrineCache);
158159

159160
This adapter also defines two optional arguments called ``namespace`` (default:

components/form.rst

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

111111
Protection against CSRF attacks is built into the Form component, but you need
112112
to 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,
157160
errors, and labels). If you use `Twig`_ as your template engine, the Form
158161
component 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>`
174171
that help you render the HTML widget, label and error for each field
@@ -242,17 +239,11 @@ via your own Twig extension.
242239

243240
To use the built-in integration, be sure that your project has Symfony's
244241
Translation 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`
258249
to your ``Twig_Environment`` instance::
@@ -293,16 +284,11 @@ no problem! Simply take the submitted/bound data of your form (which is an
293284
array or object) and pass it through your own validation system.
294285

295286
To 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
308294
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
@@ -487,7 +487,6 @@ abstraction around the HTTP response - the text-based message filled with
487487
headers and content that's sent back to the client::
488488

489489
use Symfony\Component\HttpFoundation\Response;
490-
use Symfony\Component\HttpFoundation\JsonResponse;
491490

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

controller/argument_value_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ When all those requirements are met and ``true`` is returned, the
132132
``supports()``.
133133

134134
That's it! Now all you have to do is add the configuration for the service
135-
container. This can be done by tagging the service with ``controller.argument_resolver``
135+
container. This can be done by tagging the service with ``controller.argument_value_resolver``
136136
and adding a priority.
137137

138138
.. configuration-block::

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
@@ -64,7 +64,7 @@ TwigBundle Configuration ("twig")
6464
6565
<twig:config
6666
auto-reload="%kernel.debug%"
67-
autoescape="true"
67+
autoescape="filename"
6868
base-template-class="Twig_Template"
6969
cache="%kernel.cache_dir%/twig"
7070
charset="%kernel.charset%"
@@ -95,7 +95,7 @@ TwigBundle Configuration ("twig")
9595
'pi' => 3.14,
9696
),
9797
'auto_reload' => '%kernel.debug%',
98-
'autoescape' => true,
98+
'autoescape' => 'filename',
9999
'base_template_class' => 'Twig_Template',
100100
'cache' => '%kernel.cache_dir%/twig',
101101
'charset' => '%kernel.charset%',
@@ -131,8 +131,7 @@ autoescape
131131

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

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

138137
.. caution::

service_container/lazy_services.rst

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

8080
The actual class will be instantiated as soon as you try to interact with the
8181
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