File tree 17 files changed +244
-111
lines changed
Filter options
17 files changed +244
-111
lines changed
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ exist::
153
153
// returns 'baz'
154
154
155
155
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
157
157
``foo `` parameter and you will get back an array with a ``bar `` element::
158
158
159
159
// the query string is '?foo[bar]=baz'
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ characters long::
46
46
}
47
47
}
48
48
49
+ The validator returns the list of violations.
50
+
49
51
Retrieving a Validator Instance
50
52
-------------------------------
51
53
Original file line number Diff line number Diff line change @@ -138,8 +138,11 @@ the registration of a listener for the ``response`` event::
138
138
139
139
$response->setContent($response->getContent().'GA CODE');
140
140
});
141
+
142
+ $controllerResolver = new ControllerResolver();
143
+ $argumentResolver = new ArgumentResolver();
141
144
142
- $framework = new Simplex\Framework($dispatcher, $matcher, $resolver );
145
+ $framework = new Simplex\Framework($dispatcher, $matcher, $controllerResolver, $argumentResolver );
143
146
$response = $framework->handle($request);
144
147
145
148
$response->send();
Original file line number Diff line number Diff line change @@ -562,10 +562,10 @@ the correct values of a number of field options.
562
562
field ``nullable ``). This is very useful, as your client-side validation will
563
563
automatically match your validation rules.
564
564
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).
569
569
570
570
.. caution ::
571
571
Original file line number Diff line number Diff line change @@ -68,12 +68,7 @@ random) number and prints it. To do that, create a "Controller class" and a
68
68
Before diving into this, test it out! If you are using PHP's internal web server
69
69
go to:
70
70
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
77
72
78
73
If you see a lucky number being printed back to you, congratulations! But before
79
74
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 @@ -416,7 +416,14 @@ use_referer
416
416
**type **: ``boolean `` **default **: ``false ``
417
417
418
418
If ``true ``, the user is redirected to the value stored in the ``HTTP_REFERER ``
419
- header when no previous URL was stored in the session.
419
+ header when no previous URL was stored in the session. If the referrer URL is
420
+ the same as the one generated with the ``login_path `` route, the user is
421
+ redirected to the ``default_target_path `` to avoid a redirection loop.
422
+
423
+ .. note ::
424
+
425
+ For historical reasons, and to match the misspelling of the HTTP standard,
426
+ the option is called ``use_referer `` instead of ``use_referrer ``.
420
427
421
428
.. _reference-security-pbkdf2 :
422
429
Original file line number Diff line number Diff line change @@ -940,6 +940,10 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface`.
940
940
941
941
For more details, see :doc: `/serializer `.
942
942
943
+ The priorities of the default normalizers can be found in the
944
+ :method: `Symfony\\ Bundle\\ FrameworkBundle\\ DependencyInjection\\ FrameworkExtension::registerSerializerConfiguration `
945
+ method.
946
+
943
947
swiftmailer.default.plugin
944
948
--------------------------
945
949
Original file line number Diff line number Diff line change @@ -277,6 +277,15 @@ form you have to set this option to true. However, existing collection entries
277
277
will only be deleted if you have the allow_delete _ option enabled. Otherwise
278
278
the empty values will be kept.
279
279
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
+
280
289
entry_options
281
290
~~~~~~~~~~~~~
282
291
Original file line number Diff line number Diff line change @@ -101,12 +101,14 @@ make the following changes::
101
101
'attr' => ['class' => 'js-datepicker'],
102
102
));
103
103
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:
105
106
106
107
.. code-block :: html
107
108
108
109
<script >
109
110
$ (document ).ready (function () {
111
+ // configure the bootstrap datepicker
110
112
$ (' .js-datepicker' ).datepicker ({
111
113
format: ' yyyy-mm-dd'
112
114
});
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ option on the form.
71
71
72
72
.. include :: /reference/forms/types/options/data_class.rst.inc
73
73
74
+ .. _reference-form-option-empty-data :
75
+
74
76
.. include :: /reference/forms/types/options/empty_data.rst.inc
75
77
:end-before: DEFAULT_PLACEHOLDER
76
78
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
You can’t perform that action at this time.
0 commit comments