added router to main

This commit is contained in:
tracer 2022-10-24 20:12:48 +02:00
parent 10efd6d1a6
commit 66f02c8c6e
1 changed files with 8 additions and 2 deletions

View File

@ -10,23 +10,29 @@
namespace App\Controller;
use App\Entity\User;
use App\Service\Router;
use App\Service\Template;
use App\Repository\UserRepository;
use JetBrains\PhpStorm\NoReturn;
class AddressBookController
{
public function __construct(
private readonly Template $template,
private readonly User $user,
private readonly UserRepository $userRepository
private readonly UserRepository $userRepository,
private readonly Router $router
)
{
// empty body
}
#[NoReturn]
public function main(): void
{
$this->template->render(templateName: 'index.html.php', vars: [
'user' => $this->user
'user' => $this->user,
'router' => $this->router
]);
}