Skip to content

Commit

Permalink
Presenter: try to find Template file for each action (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
lulco committed Feb 5, 2021
1 parent 189891d commit e1717ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@ protected function createTemplate(/*string $class = null*/): Template
}


public function formatTemplateClass(): ?string
{
$class = preg_replace('#Presenter$#', ucfirst($this->action) . 'Template', static::class);
if (class_exists($class) && is_a($class, Template::class, true)) {
return $class;
}
return parent::formatTemplateClass();
}


/********************* partial AJAX rendering ****************d*g**/


Expand Down

0 comments on commit e1717ca

Please sign in to comment.