Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | #[Route('/{slug}', name: 'public_page_show', methods: ['GET'])] |
||
22 | public function show(string $slug, PageRepository $pageRepo): Response |
||
23 | { |
||
24 | $accessUrl = $this->accessUrlHelper->getCurrent(); |
||
25 | |||
26 | $page = $pageRepo->findOneBy([ |
||
27 | 'slug' => $slug, |
||
28 | 'enabled' => true, |
||
29 | 'url' => $accessUrl, |
||
30 | ]); |
||
31 | |||
32 | if (!$page) { |
||
33 | throw $this->createNotFoundException('Page not found or not available for this access URL'); |
||
34 | } |
||
35 | |||
36 | return $this->render('@ChamiloCore/Page/show.html.twig', [ |
||
37 | 'page' => $page, |
||
38 | ]); |
||
56 |