| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function show(Trick $trick, string $slug) |
||
| 16 | { |
||
| 17 | |||
| 18 | //Checking if slug is equal to the ID. This is for SEO and external links |
||
| 19 | if ($trick->getSlug() !== $slug) { |
||
| 20 | return $this->redirectToRoute('trick.show', [ |
||
| 21 | 'id' => $trick->getId(), |
||
| 22 | 'slug' => $trick->getSlug() |
||
| 23 | ], 301); |
||
| 24 | } |
||
| 25 | |||
| 26 | return $this->render('trick/show.html.twig', [ |
||
| 27 | 'trick' => $trick, |
||
| 28 | ]); |
||
| 32 |