8000 Merge branch '4.4' · symfony/symfony-docs@b24ba25 · GitHub
[go: up one dir, main page]

Skip to content

Commit b24ba25

Browse files
committed
Merge branch '4.4'
* 4.4: [#12231] Explicitly name the options that can be configured through tags Explain how to add `from_transport` on `messenger.message_handler` tag Documented the new REMOTE_ADDR option [#12464] Minor changes Add Composer installation before step 1 for Symfony Flex Documentation for Bootstrap 4 custom switches
2 parents b247054 + 8980712 commit b24ba25

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

bundles/best_practices.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ following standardized instructions in your ``README.md`` file.
277277
Installation
278278
============
279279
280+
Make sure Composer is installed globally, as explained in the
281+
[installation chapter](https://getcomposer.org/doc/00-intro.md)
282+
of the Composer documentation.
283+
280284
Applications that use Symfony Flex
281285
----------------------------------
282286
@@ -298,10 +302,6 @@ following standardized instructions in your ``README.md`` file.
298302
$ composer require <package-name>
299303
```
300304
301-
This command requires you to have Composer installed globally, as explained
302-
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
303-
of the Composer documentation.
304-
305305
### Step 2: Enable the Bundle
306306
307307
Then, enable the bundle by adding it to the list of registered bundles
@@ -321,7 +321,9 @@ following standardized instructions in your ``README.md`` file.
321321
Installation
322322
============
323323
324-
Applications that use Symfony Flex
324+
Make sure Composer is installed globally, as explained in the
325+
`installation chapter`_ of the Composer documentation.
326+
325327
----------------------------------
326328
327329
Open a command console, enter your project directory and execute:
@@ -343,9 +345,6 @@ following standardized instructions in your ``README.md`` file.
343345
344346
$ composer require <package-name>
345347
346-
This command requires you to have Composer installed globally, as explained
347-
in the `installation chapter`_ of the Composer documentation.
348-
349348
Step 2: Enable the Bundle
350349
~~~~~~~~~~~~~~~~~~~~~~~~~
351350

deployment/proxies.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,18 @@ In this case, you'll need to - *very carefully* - trust *all* proxies.
6565

6666
// ...
6767
Request::setTrustedProxies(
68-
// trust *all* requests
69-
['127.0.0.1', $request->server->get('REMOTE_ADDR')],
68+
// trust *all* requests (the 'REMOTE_ADDR' string is replaced at
69+
// run time by $_SERVER['REMOTE_ADDR'])
70+
['127.0.0.1', 'REMOTE_ADDR'],
7071

7172
// if you're using ELB, otherwise use a constant from above
7273
Request::HEADER_X_FORWARDED_AWS_ELB
7374
);
7475

76+
.. versionadded:: 4.4
77+
78+
The support for the ``REMOTE_ADDR`` option was introduced in Symfony 4.4.
79+
7580
That's it! It's critical that you prevent traffic from all non-trusted sources.
7681
If you allow outside traffic, they could "spoof" their true IP address and
7782
other information.

form/bootstrap4.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,22 @@ for **all** users.
9191
Custom Forms
9292
------------
9393

94+
.. versionadded:: 4.4
95+
96+
Support for the ``switch-custom`` class was introduced in Symfony 4.4.
97< D7AE /td>+
9498
Bootstrap 4 has a feature called "`custom forms`_". You can enable that on your
95-
Symfony Form ``RadioType`` and ``CheckboxType`` by adding a class called ``radio-custom``
96-
and ``checkbox-custom`` respectively.
99+
Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes to the label:
100+
101+
* For a `custom radio`_, use ``radio-custom``;
102+
* For a `custom checkbox`_, use ``checkbox-custom``;
103+
* For having a `switch instead of a checkbox`_, use ``switch-custom``.
97104

98105
.. code-block:: twig
99106
100107
{{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }}
101108
{{ form_row(form.myCheckbox, {label_attr: {class: 'checkbox-custom'} }) }}
109+
{{ form_row(form.myCheckbox, {label_attr: {class: 'switch-custom'} }) }}
102110
103111
Labels and Errors
104112
-----------------
@@ -112,4 +120,7 @@ is a strong connection between the error and its ``<input>``, as required by the
112120
`WCAG 2.0 standard`_.
113121

114122
.. _`WCAG 2.0 standard`: https://www.w3.org/TR/WCAG20/
115-
.. _`custom forms`: https://getbootstrap.com/docs/4.1/components/forms/#custom-forms
123+
.. _`custom forms`: https://getbootstrap.com/docs/4.3/components/forms/#custom-forms
124+
.. _`custom radio`: https://getbootstrap.com/docs/4.3/components/forms/#radios
125+
.. _`custom checkbox`: https://getbootstrap.com/docs/4.3/components/forms/#checkboxes
126+
.. _`switch instead of a checkbox`: https://getbootstrap.com/docs/4.3/components/forms/#switches

messenger.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,6 @@ by tagging the handler service with ``messenger.message_handler``
10161016
# only needed if can't be guessed by type-hint
10171017
handles: App\Message\SmsNotification
10181018
1019-
# options returned by getHandledMessages() are supported here
1020-
10211019
.. code-block:: xml
10221020
10231021
<!-- config/services.xml -->
@@ -1029,7 +1027,9 @@ by tagging the handler service with ``messenger.message_handler``
10291027
10301028
<services>
10311029
<service id="App\MessageHandler\SmsNotificationHandler">
1032-
<tag name="messenger.message_handler"/>
1030+
<!-- handles is only needed if it can't be guessed by type-hint -->
1031+
<tag name="messenger.message_handler"
1032+
handles="App\Message\SmsNotification"/>
10331033
</service>
10341034
</services>
10351035
</container>
@@ -1038,9 +1038,26 @@ by tagging the handler service with ``messenger.message_handler``
10381038
10391039
// config/services.php
10401040
use App\MessageHandler\SmsNotificationHandler;
1041+
use App\Message\SmsNotification;
10411042
10421043
$container->register(SmsNotificationHandler::class)
1043-
->addTag('messenger.message_handler');
1044+
->addTag('messenger.message_handler', [
1045+
// only needed if can't be guessed by type-hint
1046+
'handles' => SmsNotification::class,
1047+
]);
1048+
1049+
1050+
Possible options to configure with tags are:
1051+
1052+
* ``bus``
1053+
* ``from_transport``
1054+
* ``handles``
1055+
* ``method``
1056+
* ``priority``
1057+
1058+
.. versionadded:: 4.4
1059+
1060+
The ability to specify ``from_transport`` on the tag, was added in Symfony 4.4.
10441061

10451062
Handler Subscriber & Options
10461063
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
0