diff --git a/messenger.rst b/messenger.rst index edd43cd7881..eda3d7b16d3 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1954,6 +1954,67 @@ may want to use: ], ]); +Other Middlewares +~~~~~~~~~~~~~~~~~ + +.. versionadded:: 5.3 + + The ``router_context`` middleware were introduced in Symfony 5.3. + +When the consumer needs to build an absolute URL, for instance: rendering a +template with links, it needs the initial's request context in order to +retrieves the domain and information needed to build the URL. This can be +achieved by declaring the ``router_context`` middleware in the bus. + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/messenger.yaml + framework: + messenger: + buses: + command_bus: + middleware: + - router_context + + .. code-block:: xml + + + + + + + + + + + + + + + .. code-block:: php + + // config/packages/messenger.php + $container->loadFromExtension('framework', [ + 'messenger' => [ + 'buses' => [ + 'command_bus' => [ + 'middleware' => [ + 'router_context', + ], + ], + ], + ], + ]); + + Messenger Events ~~~~~~~~~~~~~~~~ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy