added router to main
This commit is contained in:
parent
10efd6d1a6
commit
66f02c8c6e
|
@ -10,23 +10,29 @@
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
use App\Service\Router;
|
||||||
use App\Service\Template;
|
use App\Service\Template;
|
||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
|
use JetBrains\PhpStorm\NoReturn;
|
||||||
|
|
||||||
class AddressBookController
|
class AddressBookController
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Template $template,
|
private readonly Template $template,
|
||||||
private readonly User $user,
|
private readonly User $user,
|
||||||
private readonly UserRepository $userRepository
|
private readonly UserRepository $userRepository,
|
||||||
|
private readonly Router $router
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// empty body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[NoReturn]
|
||||||
public function main(): void
|
public function main(): void
|
||||||
{
|
{
|
||||||
$this->template->render(templateName: 'index.html.php', vars: [
|
$this->template->render(templateName: 'index.html.php', vars: [
|
||||||
'user' => $this->user
|
'user' => $this->user,
|
||||||
|
'router' => $this->router
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue