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

Skip to content

Commit 322fff2

Browse files
committed
Merge branch '4.2'
* 4.2: Typo fix indention for twig example use html+twig instead of twig for some examples
2 parents 6f0815a + 25b242e commit 322fff2

9 files changed

+31
-32
lines changed

cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Cache
55
=====
66

7-
Using cache is a great way of making you application run quicker. The Symfony cache
7+
Using cache is a great way of making your application run quicker. The Symfony cache
88
component is shipped with many adapters to different storages. Every adapter is
99
developed for high performance.
1010

form/bootstrap4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ configuration:
6666
If you prefer to apply the Bootstrap styles on a form to form basis, include the
6767
``form_theme`` tag in the templates where those forms are used:
6868

69-
.. code-block:: twig
69+
.. code-block:: html+twig
7070

7171
{# ... #}
7272
{# this tag only applies to the forms defined in this template #}

frontend/encore/server-data.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In Symfony applications, you may find that you need to pass some dynamic data
66
dynamic configuration is by storing information in ``data`` attributes and reading
77
them later in JavaScript. For example:
88

9-
.. code-block:: twig
9+
.. code-block:: html+twig
1010

1111
<div class="js-user-rating" data-is-authenticated="{{ app.user ? 'true' : 'false' }}">
1212
<!-- ... -->
@@ -36,7 +36,7 @@ store any content. In Twig, use the ``html_attr`` escaping strategy to avoid mes
3636
with HTML attributes. For example, if your ``User`` object has some ``getProfileData()``
3737
method that returns an array, you could do the following:
3838

39-
.. code-block:: twig
39+
.. code-block:: html+twig
4040

4141
<div data-user-profile="{{ app.user ? app.user.profileData|json_encode|e('html_attr') }}">
4242
<!-- ... -->

frontend/encore/simple-example.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Congrats! You now have three new files:
8383
Next, include these in your base layout file. Two Twig helpers from WebpackEncoreBundle
8484
can do most of the work for you:
8585

86-
.. code-block:: twig
86+
.. code-block:: html+twig
8787

8888
{# templates/base.html.twig #}
8989
<!DOCTYPE html>

frontend/encore/split-chunks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Twig functions from WebpackEncoreBundle, you don't need to do anything else! The
3333
functions automatically read this file and render as many ``script`` or ``link``
3434
tags as needed:
3535

36-
.. code-block:: twig
36+
.. code-block:: html+twig
3737

3838
{#
3939
May now render multiple script tags:

frontend/encore/versioning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ an ``img`` tag) to certain assets. If you're using Symfony, just activate the
6464
That's it! Be sure to wrap each path in the Twig ``asset()`` function
6565
like normal:
6666

67-
.. code-block:: twig
67+
.. code-block:: html+twig
6868

6969
<img src="{{ asset('build/images/logo.png') }}">
7070

templating.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,11 @@ Suppose ``description`` equals ``I <3 this product``:
777777

778778
.. code-block:: twig
779779
780-
<!-- output escaping is on automatically -->
781-
{{ description }} <!-- I &lt;3 this product -->
780+
{# output escaping is on automatically #}
781+
{{ description }} {# I &lt;3 this product #}
782782
783-
<!-- disable output escaping with the raw filter -->
784-
{{ description|raw }} <!-- I <3 this product -->
783+
{# disable output escaping with the raw filter #}
784+
{{ description|raw }} {# I <3 this product #}
785785
786786
.. caution::
787787

translation.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,18 @@ texts* and complex expressions:
307307
that your translated message is *not* output escaped, you must apply
308308
the ``raw`` filter after the translation filter:
309309

310-
.. code-block:: twig
310+
.. code-block:: html+twig
311311

312-
{# text translated between tags is never escaped #}
313-
{% trans %}
314-
<h3>foo</h3>
315-
{% endtrans %}
312+
{# text translated between tags is never escaped #}
313+
{% trans %}
314+
<h3>foo</h3>
315+
{% endtrans %}
316316

317-
{% set message = '<h3>foo</h3>' %}
317+
{% set message = '<h3>foo</h3>' %}
318318

319-
{# strings and variables translated via a filter are escaped by default #}
320-
{{ message|trans|raw }}
321-
{{ '<h3>bar</h3>'|trans|raw }}
319+
{# strings and variables translated via a filter are escaped by default #}
320+
{{ message|trans|raw }}
321+
{{ '<h3>bar</h3>'|trans|raw }}
322322
323323
.. tip::
324324

web_link.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ Preloading Assets
2727

2828
Imagine that your application includes a web page like this:
2929

30-
.. code-block:: twig
30+
.. code-block:: html
3131

32-
{# templates/homepage.html.twig #}
3332
<!DOCTYPE html>
3433
<html>
3534
<head>
@@ -39,7 +38,7 @@ Imagine that your application includes a web page like this:
3938
</head>
4039
<body>
4140
<main role="main" class="container">
42-
{# ... some content here ... #}
41+
<!-- ... -->
4342
</main>
4443
</body>
4544
</html>
@@ -58,10 +57,10 @@ To do that, first install the WebLink component:
5857
Now, update the template to use the ``preload()`` Twig function provided by
5958
WebLink:
6059

61-
.. code-block:: twig
60+
.. code-block:: html+twig
6261

6362
<head>
64-
{# ... #}
63+
<!-- ... -->
6564
<link rel="stylesheet" href="{{ preload('/app.css') }}">
6665
</head>
6766

@@ -72,10 +71,10 @@ requested the HTML page.
7271
Additionally, according to `the Priority Hints specification`_, you can signal
7372
the priority of the resource to download using the ``importance`` attribute:
7473

75-
.. code-block:: twig
74+
.. code-block:: html+twig
7675

7776
<head>
78-
{# ... #}
77+
<!-- ... -->
7978
<link rel="stylesheet" href="{{ preload('/app.css', { importance: 'low' }) }}">
8079
</head>
8180

@@ -102,10 +101,10 @@ improve performance of your applications in production right now.
102101
If you want to prevent the push but let the browser preload the resource by
103102
issuing an early separate HTTP request, use the ``nopush`` option:
104103

105-
.. code-block:: twig
104+
.. code-block:: html+twig
106105

107106
<head>
108-
{# ... #}
107+
<!-- ... -->
109108
<link rel="stylesheet" href="{{ preload('/app.css', { nopush: true }) }}">
110109
</head>
111110

@@ -135,12 +134,12 @@ The component also supports sending HTTP links not related to performance and
135134
any link implementing the `PSR-13`_ standard. For instance, any
136135
`link defined in the HTML specification`_:
137136

138-
.. code-block:: twig
137+
.. code-block:: html+twig
139138

140139
<head>
141-
{# ... #}
140+
<!-- ... -->
142141
<link rel="alternate" href="{{ link('/index.jsonld', 'alternate') }}">
143-
<link rel="stylesheet" href="{{ preload('/app.css', {nopush: true}) }}">
142+
<link rel="stylesheet" href="{{ preload('/app.css', { nopush: true }) }}">
144143
</head>
145144

146145
The previous snippet will result in this HTTP header being sent to the client:

0 commit comments

Comments
 (0)
0