This commit is contained in:
2024-04-19 10:27:36 +02:00
parent fcb6bbe566
commit 35c96e715c
7852 changed files with 4815 additions and 8 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace App\Presenters;
trait Presentable
{
protected $presenterInterface;
public function present()
{
if (! $this->presenter || ! class_exists($this->presenter)) {
throw new \Exception('Presenter class does not exist');
}
if (! isset($this->presenterInterface)) {
$this->presenterInterface = new $this->presenter($this);
}
return $this->presenterInterface;
}
}