merge_email_verifier #3

Merged
tracer merged 23 commits from merge_email_verifier into master 2022-11-04 10:35:23 +01:00
1 changed files with 11 additions and 3 deletions
Showing only changes of commit e3fedb0ea9 - Show all commits

View File

@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\Pages;
use App\Repository\PagesRepository;
use App\Repository\UserRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@ -11,7 +12,7 @@ use Symfony\Component\Routing\Annotation\Route;
class PagesController extends AbstractController
{
#[Route(path: '/pages/{slug}', name: 'pages_display')]
public function display(PagesRepository $pagesRepository, string $slug): Response
public function display(PagesRepository $pagesRepository, UserRepository $userRepository, string $slug): Response
{
$page = $pagesRepository->findOneBy([
'slug' => $slug,
@ -23,10 +24,17 @@ class PagesController extends AbstractController
$page->setContent(content: '404 - The requested page was not found.');
}
dump($page);
dump($page->getOwner());
$user = $userRepository->findOneBy(['id' => $page->getOwner()->getId()]);
dd($user);
return $this->render(view: '@default/pages/index.html.twig', parameters: [
'page_name' => $page->getName(),
'page_content' => $page->getContent()
'page_content' => $page->getContent(),
'created_at' => $page->getCreatedAt(),
'modified_at' => $page->getModifiedAt(),
'owner' => $page->getOwner()
]);
}
}