Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40ce796

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: (37 commits) [#8192] use path() in PHP templates Reworded the article about form login redirects Explained the edge-case where the use_referer option doesn't work [#7572] fix wording [#7585] remove trailing whitespaces [#7585] minor rewording Fixed a typo Fixed a typo Update parent_services for tip consistency [#7685] use the method role Minor change Updating doc to specify priority of default normalizer [#7767] remove trailing space [#7767] replace "options" with "entry_options" [#7767] minor rewording [#8047] add inline code comment Fixed the issue in a different way Jquery datePicker syntax update [#8104] minor rewording Add more precision about automatic provider assignation ...
2 parents 7bd58ae + cff2ee2 commit 40ce796

File tree

17 files changed

+244
-120
lines changed

17 files changed

+244
-120
lines changed

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ exist::
153153
// returns 'baz'
154154

155155
When PHP imports the request query, it handles request parameters like
156-
``foo[bar]=bar`` in a special way as it creates an array. So you can get the
156+
``foo[bar]=baz`` in a special way as it creates an array. So you can get the
157157
``foo`` parameter and you will get back an array with a ``bar`` element::
158158

159159
// the query string is '?foo[bar]=baz'

components/validator.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ characters long::
4646
}
4747
}
4848

49+
The validator returns the list of violations.
50+
4951
Retrieving a Validator Instance
5052
-------------------------------
5153

controller/service.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,19 @@ These are the main **advantages** of defining controllers as services:
2323
service container configuration. This is useful when developing reusable bundles;
2424
* Your controllers are more "sandboxed". By looking at the constructor arguments,
2525
it's easy to see what types of things this controller may or may not do;
26+
* If you're not passing some required dependencies or if you are injecting some
27+
non-existent services, you'll get errors during the container compilation
28+
instead of during runtime execution;
2629
* Since dependencies must be injected manually, it's more obvious when your
2730
controller is becoming too big (i.e. if you have many constructor arguments).
2831

2932
These are the main **drawbacks** of defining controllers as services:
3033

31-
* It takes more work to create the controllers because they don't have
32-
automatic access to the services or to the base controller shortcuts;
34+
* It takes more work to create the controllers and they become more verbose
35+
because they don't have automatic access to the services and the base
36+
controller shortcuts;
3337
* The constructor of the controllers can rapidly become too complex because you
34-
must inject every single dependency needed by them;
35-
* The code of the controllers is more verbose because you can't use the shortcuts
36-
of the base controller and you must replace them with some lines of code.
38+
must inject every single dependency needed by them.
3739

3840
The recommendation from the :doc:`best practices </best_practices/controllers>`
3941
is also valid for controllers defined as services: avoid putting your business

forms.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,10 @@ the correct values of a number of field options.
562562
field ``nullable``). This is very useful, as your client-side validation will
563563
automatically match your validation rules.
564564

565-
``max_length``
566-
If the field is some sort of text field, then the ``max_length`` option can be
567-
guessed from the validation constraints (if ``Length`` or ``Range`` is used) or
568-
from the Doctrine metadata (via the field's length).
565+
``maxlength``
566+
If the field is some sort of text field, then the ``maxlength`` option attribute
567+
can be guessed from the validation constraints (if ``Length`` or ``Range`` is used)
568+
or from the Doctrine metadata (via the field's length).
569569

570570
.. caution::
571571

page_creation.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ random) number and prints it. To do that, create a "Controller class" and a
6868
Before diving into this, test it out! If you are using PHP's internal web server
6969
go to:
7070

71-
http://localhost:8000/app_dev.php/lucky/number
72-
73-
.. tip::
74-
75-
If you're using the built-in PHP web-server, you can omit the ``app_dev.php``
76-
part of the URL.
71+
http://localhost:8000/lucky/number
7772

7873
If you see a lucky number being printed back to you, congratulations! But before
7974
you run off to play the lottery, check out how this works. Remember the two steps

reference/configuration/security.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,14 @@ use_referer
414414
**type**: ``boolean`` **default**: ``false``
415415

416416
If ``true``, the user is redirected to the value stored in the ``HTTP_REFERER``
417-
header when no previous URL was stored in the session.
417+
header when no previous URL was stored in the session. If the referrer URL is
418+
the same as the one generated with the ``login_path`` route, the user is
419+
redirected to the ``default_target_path`` to avoid a redirection loop.
420+
421+
.. note::
422+
423+
For historical reasons, and to match the misspelling of the HTTP standard,
424+
the option is called ``use_referer`` instead of ``use_referrer``.
418425

419426
.. _reference-security-pbkdf2:
420427

reference/dic_tags.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,10 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface`.
10031003

10041004
For more details, see :doc:`/serializer`.
10051005

1006+
The priorities of the default normalizers can be found in the
1007+
:method:`Symfony\\Bundle\\FrameworkBundle\\DependencyInjection\\FrameworkExtension::registerSerializerConfiguration`
1008+
method.
1009+
10061010
swiftmailer.default.plugin
10071011
--------------------------
10081012

reference/forms/types/collection.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,15 @@ form you have to set this option to true. However, existing collection entries
277277
will only be deleted if you have the allow_delete_ option enabled. Otherwise
278278
the empty values will be kept.
279279

280+
.. caution::
281+
282+
The ``delete_empty`` option only removes items when the normalized value is
283+
``null``. If the nested `type`_ is a compound form type, you must either set
284+
the ``required`` option to ``false`` or set the ``empty_data`` option to
285+
``null``. Both of these options can be set inside `entry_options`_. Read
286+
about the :ref:`form's empty_data option <reference-form-option-empty-data>`
287+
to learn why this is necessary.
288+
280289
entry_options
281290
~~~~~~~~~~~~~
282291

reference/forms/types/date.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ make the following changes::
101101
'attr' => ['class' => 'js-datepicker'],
102102
));
103103

104-
Assuming you're using jQuery, you can initialize the date picker via:
104+
Then, add the following JavaScript code in your template to initialize the date
105+
picker:
105106

106107
.. code-block:: html
107108

108109
<script>
109110
$(document).ready(function() {
111+
// configure the bootstrap datepicker
110112
$('.js-datepicker').datepicker({
111113
format: 'yyyy-mm-dd'
112114
});

reference/forms/types/form.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ option on the form.
7171

7272
.. include:: /reference/forms/types/options/data_class.rst.inc
7373

74+
.. _reference-form-option-empty-data:
75+
7476
.. include:: /reference/forms/types/options/empty_data.rst.inc
7577
:end-before: DEFAULT_PLACEHOLDER
7678

reference/forms/types/options/data.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ an individual field, you can set it in the data option::
2020

2121
The ``data`` option *always* overrides the value taken from the domain data
2222
(object) when rendering. This means the object value is also overriden when
23-
the form edits an already persisted object, causing it to lose it's
23+
the form edits an already persisted object, causing it to lose its
2424
persisted value when the form is submitted.

routing/scheme.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ the URI scheme via schemes:
4848
The above configuration forces the ``secure`` route to always use HTTPS.
4949

5050
When generating the ``secure`` URL, and if the current scheme is HTTP, Symfony
51-
will automatically generate an absolute URL with HTTPS as the scheme:
51+
will automatically generate an absolute URL with HTTPS as the scheme, even when
52+
using the ``path()`` function:
5253

5354
.. code-block:: twig
5455
5556
{# If the current scheme is HTTPS #}
5657
{{ path('secure') }}
57-
{# generates /secure #}
58+
{# generates a relative URL: /secure #}
5859
5960
{# If the current scheme is HTTP #}
6061
{{ path('secure') }}
61-
{# generates https://example.com/secure #}
62+
{# generates an absolute URL: https://example.com/secure #}
6263
6364
The requirement is also enforced for incoming requests. If you try to access
6465
the ``/secure`` path with HTTP, you will automatically be redirected to the

0 commit comments

Comments
 (0)