8000 Merge branch '3.0' into 3.1 · symfony/symfony-docs@8a53e58 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a53e58

Browse files
committed
Merge branch '3.0' into 3.1
2 parents e00c866 + 6e7a7cb commit 8a53e58

13 files changed

+24
-23
lines changed

best_practices/templates.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 1 deletion
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
------------------

controller/error_pages.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ To override the 404 error template for HTML pages, create a new
9999
{% block body %}
100100
<h1>Page not found</h1>
101101

102-
{# example security usage, see below #}
103102
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
104103
{# ... #}
105104
{% endif %}

form/form_collections.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ your controller::
234234

235235
$form->handleRequest($request);
236236

237-
if ($form->isSubmitted() && $form->()) {
237+
if ($form->isSubmitted() && $form->isValid()) {
238238
// $form->getData() holds the submitted values
239239
// but, the original `$task` variable has also been updated
240240
$task = $form->getData();

http_cache.rst

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

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

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

routing/conditions.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

setup/file_permissions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ needed permissions:
3131

3232
.. code-block:: bash
3333
34-
$ rm -rf app/cache/*
35-
$ rm -rf app/logs/*
34+
$ rm -rf var/cache/*
35+
$ rm -rf var/logs/*
3636
3737
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
3838
$ sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var

validation/custom_constraint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Constraint Validators with Dependencies
158158
If your constraint validator has dependencies, such as a database connection,
159159
it will need to be configured as a service in the Dependency Injection
160160
Container. This service must include the ``validator.constraint_validator``
161-
tag so that the validation system knows about it::
161+
tag so that the validation system knows about it:
162162

163163
.. configuration-block::
164164

0 commit comments

Comments
 (0)
0