Skip to content

Commit 1fbc169

Browse files
committed
Add docs for the new post_response event
1 parent e1171cb commit 1fbc169

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎user_guide_src/source/changelogs/v4.8.0.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ Others
350350
- **Filters:** Added ``RequestId`` filter for request tracing and correlation logging. The filter stores the request ID in the request context and automatically adds the ``X-Request-ID`` response header. Incoming ``X-Request-ID`` headers are used when valid. See :ref:`requestid` for details.
351351
- **Environment:** Added ``CodeIgniter\EnvironmentDetector`` class and corresponding ``environment`` service as a mockable wrapper around the ``ENVIRONMENT`` constant.
352352
Framework internals that previously compared ``ENVIRONMENT`` directly now go through this service, making environment-specific branches reachable in tests via ``Services::injectMock()``. See :ref:`environment-detector-service`.
353+
- **Events**: Added ``post_response`` event to run after the response is sent to the client.
353354
- **Time:** Added ``Time::between()``, ``Time::min()``, and ``Time::max()`` comparison helpers. See :ref:`between <time-comparing-two-times-between>`, :ref:`min <time-comparing-two-times-min>`, and :ref:`max <time-comparing-two-times-max>`.
354355

355356
***************

‎user_guide_src/source/extending/events.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ invoked by **public/index.php**:
9999
* **post_controller_constructor** Called immediately after your controller is instantiated, but prior to any method calls happening.
100100
* **post_system** Called right before the final rendered page is sent to the browser,
101101
at the end of system execution, after the execution of "after" controller filters.
102+
* **post_response** Called after the response is sent to the client. This event is useful
103+
for performing tasks that do not need to be completed before the response is sent, such as logging or cleanup tasks.
104+
105+
.. note:: The ``post_response`` event was added in v4.8.0.
102106

103107
.. _event-points-for-cli-apps:
104108

0 commit comments

Comments
 (0)