From 6f212d9854638822dc016e7a540113157533e1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sat, 13 Feb 2021 16:17:56 +0100 Subject: [PATCH] Add documentation for RouterContextMiddleware --- messenger.rst | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) 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