Skip to content

Commit 309d29f

Browse files
committed
Merge branch '2.3' into 2.7
2 parents 47704a7 + 2aac761 commit 309d29f

File tree

5 files changed

+54
-5
lines changed

5 files changed

+54
-5
lines changed

cookbook/controller/error_pages.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,56 @@ will be passed two parameters:
273273
Instead of creating a new exception controller from scratch you can, of course,
274274
also extend the default :class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController`.
275275
In that case, you might want to override one or both of the ``showAction()`` and
276-
``findTemplate()`` methods. The latter one locates the template to be used.
276+
``findTemplate()`` methods. The latter one locates the template to be used.
277+
278+
.. note::
279+
280+
In case of extending the
281+
:class:`Symfony\\Bundle\\TwigBundle\\Controller\\ExceptionController` you
282+
may configure a service to pass the Twig environment and the ``debug`` flag
283+
to the constructor.
284+
285+
.. configuration-block::
286+
287+
.. code-block:: yaml
288+
289+
# app/config/services.yml
290+
services:
291+
app.exception_controller:
292+
class: AppBundle\CustomExceptionController
293+
arguments: ['@twig', '%kernel.debug%']
294+
295+
.. code-block:: xml
296+
297+
<!-- app/config/services.xml -->
298+
<?xml version="1.0" encoding="utf-8" ?>
299+
<container xmlns="http://symfony.com/schema/dic/services"
300+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
301+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
302+
>
303+
<services>
304+
<service id="app.exception_controller"
305+
class="AppBundle\Controller\CustomExceptionController"
306+
>
307+
<argument type="service" id="twig"/>
308+
<argument>%kernel.debug%</argument>
309+
</service>
310+
</services>
311+
</container>
312+
313+
.. code-block:: php
314+
315+
// app/config/services.php
316+
use Symfony\Component\DependencyInjection\Reference;
317+
use Symfony\Component\DependencyInjection\Definition;
318+
319+
$definition = new Definition('AppBundle\Controller\CustomExceptionController', array(
320+
new Reference('twig'),
321+
'%kernel.debug%'
322+
));
323+
324+
And then configure ``twig.exception_controller`` using the controller as
325+
services syntax (e.g. ``app.exception_controller:showAction``).
277326

278327
.. tip::
279328

cookbook/email/gmail.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ that you `allow less secure apps to access your Gmail account`_.
129129

130130
.. seealso::
131131

132-
see the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
132+
See the :doc:`Swiftmailer configuration reference </reference/configuration/swiftmailer>`
133133
for more details.
134134

135135
.. _`generate an App password`: https://support.google.com/accounts/answer/185833

reference/forms/types/button.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ button Field Type
55
=================
66

77
.. versionadded:: 2.3
8-
The ``button`` type was introduced in Symfony 2.3
8+
The ``button`` type was introduced in Symfony 2.3.
99

1010
A simple, non-responsive button.
1111

reference/forms/types/reset.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ reset Field Type
55
================
66

77
.. versionadded:: 2.3
8-
The ``reset`` type was introduced in Symfony 2.3
8+
The ``reset`` type was introduced in Symfony 2.3.
99

1010
A button that resets all fields to their original values.
1111

reference/forms/types/submit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ submit Field Type
55
=================
66

77
.. versionadded:: 2.3
8-
The ``submit`` type was introduced in Symfony 2.3
8+
The ``submit`` type was introduced in Symfony 2.3.
99

1010
A submit button.
1111

0 commit comments

Comments
 (0)