Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 81e8c13

Browse filesBrowse files
committed
Merge branch '2.7'
* 2.7: [#4928] Backporting change after merging into 2.5 (since 2.3 is a little different) Update introduction.rst Change installation method order Fix typos Add missing comma in array Fix typos Fix typos Remove block which doesn't make sense after best practices Fixed a minor RST syntax issue Added a reference about including JS and CSS files in PHP templates Removed the Stable API chapter from the Symfony book
2 parents ef39a01 + 70902f5 commit 81e8c13
Copy full SHA for 81e8c13

File tree

Expand file treeCollapse file tree

10 files changed

+64
-131
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+64
-131
lines changed

‎book/index.rst

Copy file name to clipboardExpand all lines: book/index.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ The Book
2222
service_container
2323
performance
2424
internals
25-
stable_api
2625

2726
.. include:: /book/map.rst.inc

‎book/map.rst.inc

Copy file name to clipboardExpand all lines: book/map.rst.inc
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
* :doc:`/book/service_container`
1717
* :doc:`/book/performance`
1818
* :doc:`/book/internals`
19-
* :doc:`/book/stable_api`

‎book/stable_api.rst

Copy file name to clipboardExpand all lines: book/stable_api.rst
-56Lines changed: 0 additions & 56 deletions
This file was deleted.

‎book/templating.rst

Copy file name to clipboardExpand all lines: book/templating.rst
+57-24Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,43 +1085,76 @@ one called ``stylesheets`` inside the ``head`` tag and another called ``javascri
10851085
just above the closing ``body`` tag. These blocks will contain all of the
10861086
stylesheets and JavaScripts that you'll need throughout your site:
10871087

1088-
.. code-block:: html+jinja
1088+
.. configuration-block::
10891089

1090-
{# app/Resources/views/base.html.twig #}
1091-
<html>
1092-
<head>
1093-
{# ... #}
1090+
.. code-block:: html+jinja
10941091

1095-
{% block stylesheets %}
1096-
<link href="{{ asset('css/main.css') }}" rel="stylesheet" />
1097-
{% endblock %}
1098-
</head>
1099-
<body>
1100-
{# ... #}
1092+
{# app/Resources/views/base.html.twig #}
1093+
<html>
1094+
<head>
1095+
{# ... #}
11011096

1102-
{% block javascripts %}
1103-
<script src="{{ asset('js/main.js') }}"></script>
1104-
{% endblock %}
1105-
</body>
1106-
</html>
1097+
{% block stylesheets %}
1098+
<link href="{{ asset('css/main.css') }}" rel="stylesheet" />
1099+
{% endblock %}
1100+
</head>
1101+
<body>
1102+
{# ... #}
1103+
1104+
{% block javascripts %}
1105+
<script src="{{ asset('js/main.js') }}"></script>
1106+
{% endblock %}
1107+
</body>
1108+
</html>
1109+
1110+
.. code-block:: php
1111+
1112+
// app/Resources/views/base.html.php
1113+
<html>
1114+
<head>
1115+
<?php ... ?>
1116+
1117+
<?php $view['slots']->start('stylesheets') ?>
1118+
<link href="<?php echo $view['assets']->getUrl('css/main.css') ?>" rel="stylesheet" />
1119+
<?php $view['slots']->stop() ?>
1120+
</head>
1121+
<body>
1122+
<?php ... ?>
1123+
1124+
<?php $view['slots']->start('javascripts') ?>
1125+
<script src="<?php echo $view['assets']->getUrl('js/main.js') ?>"></script>
1126+
<?php $view['slots']->stop() ?>
1127+
</body>
1128+
</html>
11071129
11081130
That's easy enough! But what if you need to include an extra stylesheet or
11091131
JavaScript from a child template? For example, suppose you have a contact
11101132
page and you need to include a ``contact.css`` stylesheet *just* on that
11111133
page. From inside that contact page's template, do the following:
11121134

1113-
.. code-block:: html+jinja
1135+
.. configuration-block::
1136+
1137+
.. code-block:: html+jinja
1138+
1139+
{# app/Resources/views/Contact/contact.html.twig #}
1140+
{% extends 'base.html.twig' %}
1141+
1142+
{% block stylesheets %}
1143+
{{ parent() }}
1144+
1145+
<link href="{{ asset('css/contact.css') }}" rel="stylesheet" />
1146+
{% endblock %}
11141147

1115-
{# app/Resources/views/Contact/contact.html.twig #}
1116-
{% extends 'base.html.twig' %}
1148+
{# ... #}
11171149

1118-
{% block stylesheets %}
1119-
{{ parent() }}
1150+
.. code-block:: php
11201151
1121-
<link href="{{ asset('css/contact.css') }}" rel="stylesheet" />
1122-
{% endblock %}
1152+
// app/Resources/views/Contact/contact.html.twig
1153+
<?php $view->extend('base.html.php') ?>
11231154
1124-
{# ... #}
1155+
<?php $view['slots']->start('stylesheets') ?>
1156+
<link href="<?php echo $view['assets']->getUrl('css/contact.css') ?>" rel="stylesheet" />
1157+
<?php $view['slots']->stop() ?>
11251158
11261159
In the child template, you simply override the ``stylesheets`` block and
11271160
put your new stylesheet tag inside of that block. Of course, since you want

‎components/debug/introduction.rst

Copy file name to clipboardExpand all lines: components/debug/introduction.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Installation
1616

1717
You can install the component in many different ways:
1818

19-
* Use the official Git repository (https://github.com/symfony/Debug);
20-
* :doc:`Install it via Composer </components/using_components>` (``symfony/debug`` on `Packagist`_).
19+
* :doc:`Install it via Composer </components/using_components>` (``symfony/debug`` on `Packagist`_);
20+
* Use the official Git repository (https://github.com/symfony/Debug).
2121

2222
Usage
2323
-----

‎components/dependency_injection/parameters.rst

Copy file name to clipboardExpand all lines: components/dependency_injection/parameters.rst
-43Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -140,49 +140,6 @@ rather than being tied up and hidden with the service definition:
140140
If you were using this elsewhere as well, then you would only need to change
141141
the parameter value in one place if needed.
142142

143-
You can also use the parameters in the service definition, for example,
144-
making the class of a service a parameter:
145-
146-
.. configuration-block::
147-
148-
.. code-block:: yaml
149-
150-
parameters:
151-
mailer.transport: sendmail
152-
153-
services:
154-
mailer:
155-
class: Mailer
156-
arguments: ["%mailer.transport%"]
157-
158-
.. code-block:: xml
159-
160-
<?xml version="1.0" encoding="UTF-8" ?>
161-
<container xmlns="http://symfony.com/schema/dic/services"
162-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
163-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
164-
165-
<parameters>
166-
<parameter key="mailer.transport">sendmail</parameter>
167-
</parameters>
168-
169-
<services>
170-
<service id="mailer" class="Mailer">
171-
<argument>%mailer.transport%</argument>
172-
</service>
173-
</services>
174-
</container>
175-
176-
.. code-block:: php
177-
178-
use Symfony\Component\DependencyInjection\Reference;
179-
180-
$container->setParameter('mailer.transport', 'sendmail');
181-
182-
$container
183-
->register('mailer', 'Mailer')
184-
->addArgument('%mailer.transport%');
185-
186143
.. note::
187144

188145
The percent sign inside a parameter or argument, as part of the string, must

‎components/serializer.rst

Copy file name to clipboardExpand all lines: components/serializer.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ of the ``Person`` class would be encoded in XML format::
153153
</person>
154154
EOF;
155155

156-
$person = $serializer->deserialize($data,'Acme\Person','xml');
156+
$person = $serializer->deserialize($data, 'Acme\Person', 'xml');
157157

158158
In this case, :method:`Symfony\\Component\\Serializer\\Serializer::deserialize`
159159
needs three parameters:
@@ -326,7 +326,7 @@ having unique identifiers::
326326

327327
$serializer = new Serializer(array($normalizer), array($encoder));
328328
echo $serializer->serialize($org, 'json');
329-
// {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"]}
329+
// {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"}]}
330330

331331
JMSSerializer
332332
-------------

‎components/templating/introduction.rst

Copy file name to clipboardExpand all lines: components/templating/introduction.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ method is used.
196196
197197
$templating = new DelegatingEngine(array(
198198
new PhpEngine(...),
199-
new CustomEngine(...)
199+
new CustomEngine(...),
200200
));
201201
202202
.. _Packagist: https://packagist.org/packages/symfony/templating

‎components/var_dumper/advanced.rst

Copy file name to clipboardExpand all lines: components/var_dumper/advanced.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ like this::
2020
use Symfony\Component\VarDumper\Dumper\CliDumper;
2121
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
2222

23-
VarDumper::setHandler(function($var) {
23+
VarDumper::setHandler(function ($var) {
2424
$cloner = new VarCloner();
2525
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
2626

‎redirection_map

Copy file name to clipboardExpand all lines: redirection_map
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/book/stable_api /contributing/code/bc
12
/cookbook/deployment-tools /cookbook/deployment/tools
23
/cookbook/doctrine/migrations /bundles/DoctrineFixturesBundle/index
34
/cookbook/doctrine/doctrine_fixtures /bundles/DoctrineFixturesBundle/index

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.