| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function show(Trick $trick, string $slug) |
||
| 38 | { |
||
| 39 | |||
| 40 | //Checking if slug is equal to the ID. This is for SEO and external links |
||
| 41 | if ($trick->getSlug() !== $slug) { |
||
| 42 | return $this->redirectToRoute('trick.show', [ |
||
| 43 | 'id' => $trick->getId(), |
||
| 44 | 'slug' => $trick->getSlug() |
||
| 45 | ], 301); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $this->render('trick/show.html.twig', [ |
||
| 49 | 'trick' => $trick, |
||
| 50 | ]); |
||
| 64 |