From d81167866eccf5ae19929aa759967f29989cbcbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Kep=C3=A1k?= Date: Wed, 15 May 2019 17:44:05 +0200 Subject: [PATCH] Presenter: added onRender event Added new onRender event, right after beforeRender and before actual render happends (as put it before beforeRender and called it onRender is confusing) --- src/Application/UI/Presenter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index 0fab49b58..59c4ce941 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -51,6 +51,9 @@ abstract class Presenter extends Control implements Application\IPresenter /** @var callable[]&(callable(Presenter $sender): void)[]; Occurs when the presenter is starting */ public $onStartup; + /** @var callable[]&(callable(Presenter $sender): void)[]; Occurs when the presenter is rendering after beforeRender */ + public $onRender; + /** @var callable[]&(callable(Presenter $sender, IResponse $response): void)[]; Occurs when the presenter is shutting down */ public $onShutdown; @@ -213,6 +216,7 @@ public function run(Application\Request $request): Application\IResponse // RENDERING VIEW $this->beforeRender(); + $this->onRender($this); // calls $this->render() $this->tryCall($this->formatRenderMethod($this->view), $this->params); $this->afterRender();