Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function showAction($year, $month, $day, $num, $slug) |
||
45 | { |
||
46 | $post = $this->get('AppBundle\Repository\PostRepository')->findOneBy([ |
||
47 | 'year' => $year, |
||
48 | 'month' => $month, |
||
49 | 'day' => $day, |
||
50 | 'num' => $num, |
||
51 | 'slug' => $slug |
||
52 | ]); |
||
53 | |||
54 | $sidebarPosts = $this->get('AppBundle\Repository\PostRepository')->findLatest(); |
||
55 | |||
56 | if (!$post) { |
||
57 | throw $this->createNotFoundException( |
||
58 | 'No post found for slug '.$slug |
||
59 | ); |
||
60 | } |
||
61 | |||
62 | return $this->render( |
||
63 | 'blog/show.html.twig', |
||
64 | ['post' => $post, 'sidebar_posts' => $sidebarPosts] |
||
65 | ); |
||
66 | } |
||
67 | } |
||
68 |