Skip to content

Commit 24be690

Browse files
committed
enclose YAML string with double quotes to fix syntax highlighting
1 parent 42c80d1 commit 24be690

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cookbook/routing/service_container_parameters.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ inside your routing configuration:
1818

1919
.. code-block:: yaml
2020
21+
# app/config/routing.yml
2122
contact:
2223
path: /{_locale}/contact
2324
defaults: { _controller: AcmeDemoBundle:Main:contact }
2425
requirements:
25-
_locale: %acme_demo.locales%
26+
_locale: "%acme_demo.locales%"
2627
2728
.. code-block:: xml
2829
30+
<!-- app/config/routing.xml -->
2931
<?xml version="1.0" encoding="UTF-8" ?>
30-
3132
<routes xmlns="http://symfony.com/schema/routing"
3233
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3334
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
@@ -40,6 +41,7 @@ inside your routing configuration:
4041
4142
.. code-block:: php
4243
44+
// app/config/routing.php
4345
use Symfony\Component\Routing\RouteCollection;
4446
use Symfony\Component\Routing\Route;
4547
@@ -82,14 +84,15 @@ path):
8284

8385
.. code-block:: yaml
8486
87+
# app/config/routing.yml
8588
some_route:
8689
path: /%acme_demo.route_prefix%/contact
8790
defaults: { _controller: AcmeDemoBundle:Main:contact }
8891
8992
.. code-block:: xml
9093
94+
<!-- app/config/routing.xml -->
9195
<?xml version="1.0" encoding="UTF-8" ?>
92-
9396
<routes xmlns="http://symfony.com/schema/routing"
9497
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9598
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
@@ -101,6 +104,7 @@ path):
101104
102105
.. code-block:: php
103106
107+
// app/config/routing.php
104108
use Symfony\Component\Routing\RouteCollection;
105109
use Symfony\Component\Routing\Route;
106110
@@ -116,7 +120,7 @@ path):
116120
Just like in normal service container configuration files, if you actually
117121
need a ``%`` in your route, you can escape the percent sign by doubling
118122
it, e.g. ``/score-50%%``, which would resolve to ``/score-50%``.
119-
123+
120124
However, as the ``%`` characters included in any URL are automatically encoded,
121125
the resulting URL of this example would be ``/score-50%25`` (``%25`` is the
122126
result of encoding the ``%`` character).

0 commit comments

Comments
 (0)