Merge pull request #10904 from fsamapoor/fix/update-middleware-stable25

[stable-25] Update middlewares.rst
This commit is contained in:
Faraz Samapoor 2023-08-04 10:57:57 +03:30 committed by GitHub
commit eb617ac454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ Middlewares
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>
Middleware is logic that is run before and after each request and is modelled after `Django's Middleware system <https://docs.djangoproject.com/en/dev/topics/http/middleware/>`_. It offers the following hooks:
Middleware is logic that is run before and after each request and is modeled after `Django's Middleware system <https://docs.djangoproject.com/en/dev/topics/http/middleware/>`_. It offers the following hooks:
* ``beforeController``: This is executed before a controller method is being executed. This allows you to plug additional checks or logic before that method, like for instance security checks
* ``afterException``: This is being run when either the beforeController method or the controller method itself is throwing an exception. The middleware is asked in reverse order to handle the exception and to return a response. If the middleware can't handle the exception, it throws the exception again
@ -71,7 +71,7 @@ Dependency Injection Container Registration
.. deprecated:: 20
Middlewares can also be added using the **registerMiddleware** method of the container:
Middleware can also be added using the **registerMiddleware** method of the container:
.. code-block:: php
:caption: lib/AppInfo/Application.php