File tree Expand file tree Collapse file tree 8 files changed +32
-14
lines changed
Filter options
Expand file tree Collapse file tree 8 files changed +32
-14
lines changed
Original file line number Diff line number Diff line change @@ -63,12 +63,7 @@ random) number and prints it. To do that, create a "Controller class" and a
63
63
Before diving into this, test it out! If you are using PHP's internal web server
64
64
go to:
65
65
66
- http://localhost:8000/app_dev.php/lucky/number
67
-
68
- .. tip ::
69
-
70
- If you're using the built-in PHP web-server, you can omit the ``app_dev.php ``
71
- part of the URL.
66
+ http://localhost:8000/lucky/number
72
67
73
68
If you see a lucky number being printed back to you, congratulations! But before
74
69
you run off to play the lottery, check out how this works. Remember the two steps
Original file line number Diff line number Diff line change @@ -278,6 +278,15 @@ form you have to set this option to true. However, existing collection entries
278
278
will only be deleted if you have the allow_delete _ option enabled. Otherwise
279
279
the empty values will be kept.
280
280
281
+ .. caution ::
282
+
283
+ The ``delete_empty `` option only removes items when the normalized value is
284
+ ``null ``. If the nested `type `_ is a compound form type, you must either set
285
+ the ``required `` option to ``false `` or set the ``empty_data `` option to
286
+ ``null ``. Both of these options can be set inside `options `_. Read about
287
+ the :ref: `form's empty_data option <reference-form-option-empty-data >`
288
+ to learn why this is necessary.
289
+
281
290
entry_options
282
291
~~~~~~~~~~~~~
283
292
Original file line number Diff line number Diff line change @@ -102,12 +102,14 @@ make the following changes::
102
102
'attr' => ['class' => 'js-datepicker'],
103
103
));
104
104
105
- Assuming you're using jQuery, you can initialize the date picker via:
105
+ Then, add the following JavaScript code in your template to initialize the date
106
+ picker:
106
107
107
108
.. code-block :: html
108
109
109
110
<script >
110
111
$ (document ).ready (function () {
112
+ // configure the bootstrap datepicker
111
113
$ (' .js-datepicker' ).datepicker ({
112
114
format: ' yyyy-mm-dd'
113
115
});
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ option on the form.
77
77
78
78
.. include :: /reference/forms/types/options/data_class.rst.inc
79
79
80
+ .. _reference-form-option-empty-data :
81
+
80
82
.. include :: /reference/forms/types/options/empty_data.rst.inc
81
83
:end-before: DEFAULT_PLACEHOLDER
82
84
Original file line number Diff line number Diff line change @@ -20,5 +20,5 @@ an individual field, you can set it in the data option::
20
20
21
21
The ``data`` option *always* overrides the value taken from the domain data
22
22
(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
24
24
persisted value when the form is submitted.
Original file line number Diff line number Diff line change @@ -48,17 +48,18 @@ the URI scheme via schemes:
48
48
The above configuration forces the ``secure `` route to always use HTTPS.
49
49
50
50
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:
52
53
53
54
.. code-block :: twig
54
55
55
56
{# If the current scheme is HTTPS #}
56
57
{{ path('secure') }}
57
- {# generates /secure #}
58
+ {# generates a relative URL: /secure #}
58
59
59
60
{# If the current scheme is HTTP #}
60
61
{{ path('secure') }}
61
- {# generates https://example.com/secure #}
62
+ {# generates an absolute URL: https://example.com/secure #}
62
63
63
64
The requirement is also enforced for incoming requests. If you try to access
64
65
the ``/secure `` path with HTTP, you will automatically be redirected to the
Original file line number Diff line number Diff line change @@ -82,9 +82,10 @@ a new provider that chains the two together:
82
82
),
83
83
));
84
84
85
- Now, all authentication mechanisms will use the ``chain_provider ``, since
86
- it's the first specified. The ``chain_provider `` will, in turn, try to load
87
- the user from both the ``in_memory `` and ``user_db `` providers.
85
+ Now, all firewalls without an explicitly configured user provider will use
86
+ the ``chain_provider `` since it's the first specified. The ``chain_provider ``
87
+ will, in turn, try to load the user from both the ``in_memory `` and ``user_db ``
88
+ providers.
88
89
89
90
You can also configure the firewall or individual authentication mechanisms
90
91
to use a specific provider. Again, unless a provider is specified explicitly,
Original file line number Diff line number Diff line change @@ -43,3 +43,11 @@ clean PHP process, thus avoiding any side-effects.
43
43
44
44
As an insulated client is slower, you can keep one client in the main
45
45
process, and insulate the other ones.
46
+
47
+ .. caution ::
48
+
49
+ Insulating tests requires some serializing and unserializing operations. If
50
+ your test includes data that can't be serialized, such as file streams when
51
+ using the ``UploadedFile `` class, you'll see an exception about
52
+ *"serialization is not allowed" *. This is a technical limitation of PHP, so
53
+ the only solution is to disable insulation for those tests.
You can’t perform that action at this time.
0 commit comments