Skip to content

Commit d6c8a2e

Browse files
committed
Merge branch '2.7' into 2.8
2 parents e051e98 + 8440cea commit d6c8a2e

File tree

11 files changed

+22
-20
lines changed

11 files changed

+22
-20
lines changed

best_practices/templates.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extension. The service definition only requires the path to the class:
8181
# app/config/services.yml
8282
services:
8383
# ...
84-
markdown:
84+
app.markdown:
8585
class: AppBundle\Utils\Markdown
8686
8787
And the ``Markdown`` class just needs to define one single method to transform
@@ -156,7 +156,7 @@ name is irrelevant because you never use it in your own code):
156156
services:
157157
app.twig.app_extension:
158158
class: AppBundle\Twig\AppExtension
159-
arguments: ['@markdown']
159+
arguments: ['@app.markdown']
160160
public: false
161161
tags:
162162
- { name: twig.extension }

contributing/code/standards.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ Structure
176176
Read more at :ref:`contributing-code-conventions-deprecations`;
177177

178178
* Do not use ``else``, ``elseif``, ``break`` after ``if`` and ``case`` conditions
179-
which return or throw something.
179+
which return or throw something;
180+
181+
* Do not use spaces around ``[`` offset accessor and before ``]`` offset accessor.
180182

181183
Naming Conventions
182184
------------------

form/form_collections.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ Template Modifications
607607

608608
The ``allow_delete`` option has one consequence: if an item of a collection
609609
isn't sent on submission, the related data is removed from the collection
610-
on the server. The solution is thus to remove the form element from the DOM.
610+
on the server. The solution is to remove the form element from the DOM.
611611

612612
First, add a "delete this tag" link to each tag form:
613613

form/form_customization.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ rendered.
479479
# app/config/config.yml
480480
twig:
481481
form_themes:
482-
- 'form/fields.html.twig'
482+
- 'form/fields.html.twig'
483483
# ...
484484
485485
.. code-block:: xml
@@ -495,7 +495,7 @@ rendered.
495495
// app/config/config.php
496496
$container->loadFromExtension('twig', array(
497497
'form_themes' => array(
498-
'form/fields.html.twig',
498+
'form/fields.html.twig',
499499
),
500500
501501
// ...
@@ -675,7 +675,7 @@ customize the ``name`` field only:
675675

676676
<?php echo $view['form']->widget($form['name']); ?>
677677

678-
<!-- app/Resources/views/Form/_product_name_widget.html.php -->
678+
<!-- app/Resources/views/form/_product_name_widget.html.php -->
679679
<div class="text_widget">
680680
<?php echo $view['form']->block('form_widget_simple') ?>
681681
</div>
@@ -733,7 +733,7 @@ You can also override the markup for an entire field row using the same method:
733733

734734
<?php echo $view['form']->row($form['name']); ?>
735735

736-
<!-- app/Resources/views/Form/_product_name_row.html.php -->
736+
<!-- app/Resources/views/form/_product_name_row.html.php -->
737737
<div class="name_row">
738738
<?php echo $view['form']->label($form) ?>
739739
<?php echo $view['form']->errors($form) ?>

form/form_themes.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ to define form output.
271271
PHP
272272
...
273273

274-
To automatically include the customized templates from the ``app/Resources/views/Form``
274+
To automatically include the customized templates from the ``app/Resources/views/form``
275275
directory created earlier in *all* templates, modify your application configuration
276276
file:
277277

@@ -284,7 +284,7 @@ file:
284284
templating:
285285
form:
286286
resources:
287-
- 'Form'
287+
- 'form'
288288
# ...
289289
290290
.. code-block:: xml
@@ -300,7 +300,7 @@ file:
300300
<framework:config>
301301
<framework:templating>
302302
<framework:form>
303-
<framework:resource>Form</framework:resource>
303+
<framework:resource>form</framework:resource>
304304
</framework:form>
305305
</framework:templating>
306306
<!-- ... -->
@@ -314,14 +314,14 @@ file:
314314
'templating' => array(
315315
'form' => array(
316316
'resources' => array(
317-
'Form',
317+
'form',
318318
),
319319
),
320320
),
321321
// ...
322322
));
323323
324-
Any fragments inside the ``app/Resources/views/Form`` directory are now used
324+
Any fragments inside the ``app/Resources/views/form`` directory are now used
325325
globally to define form output.
326326

327327
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

forms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ your controller::
247247

248248
$form->handleRequest($request);
249249

250-
if ($form->isSubmitted() && $form->()) {
250+
if ($form->isSubmitted() && $form->isValid()) {
251251
// $form->getData() holds the submitted values
252252
// but, the original `$task` variable has also been updated
253253
$task = $form->getData();

http_cache.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ The *easiest* way to cache a response is by caching it for a specific amount of
220220
// somehow create a Response object, like by rendering a template
221221
$response = $this->render('blog/index.html.twig', []);
222222

223-
// cache for 600 seconds
224-
$response->setSharedMaxAge(600);
223+
// cache for 3600 seconds
224+
$response->setSharedMaxAge(3600);
225225

226226
// (optional) set a custom Cache-Control directive
227227
$response->headers->addCacheControlDirective('must-revalidate', true);

routing/conditions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. index::
2-
:single: Routing; Conditions
2+
single: Routing; Conditions
33

44
How to Restrict Route Matching through Conditions
55
=================================================

service_container/service_decoration.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ the original service is lost:
4040
4141
.. code-block:: php
4242
43-
$container->register('mailer', 'AppBundle\Mailer');
43+
$container->register('app.mailer', 'AppBundle\Mailer');
4444
4545
// this replaces the old app.mailer definition with the new one, the
4646
// old definition is lost
47-
$container->register('mailer', 'AppBundle\DecoratingMailer');
47+
$container->register('app.mailer', 'AppBundle\DecoratingMailer');
4848
4949
Most of the time, that's exactly what you want to do. But sometimes,
5050
you might want to decorate the old one instead. In this case, the

validation/custom_constraint.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Constraint Validators with Dependencies
167167
If your constraint validator has dependencies, such as a database connection,
168168
it will need to be configured as a service in the Dependency Injection
169169
Container. This service must include the ``validator.constraint_validator``
170-
tag so that the validation system knows about it::
170+
tag so that the validation system knows about it:
171171

172172
.. configuration-block::
173173

0 commit comments

Comments
 (0)