Skip to content

Commit

Permalink
Presenter: added onRender event
Browse files Browse the repository at this point in the history
Added new onRender event, right after beforeRender and before actual render happends (as put it before beforeRender and called it onRender is confusing)
  • Loading branch information
Radovan Kepák authored and dg committed Jul 8, 2019
1 parent 24ead35 commit d811678
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -213,6 +216,7 @@ public function run(Application\Request $request): Application\IResponse

// RENDERING VIEW
$this->beforeRender();
$this->onRender($this);
// calls $this->render<View>()
$this->tryCall($this->formatRenderMethod($this->view), $this->params);
$this->afterRender();
Expand Down

0 comments on commit d811678

Please sign in to comment.