point-tools/src/Skobkin/Bundle/PointToolsBundle/Controller/PostController.php

26 lines
807 B
PHP
Raw Normal View History

2016-03-24 22:10:10 +00:00
<?php
namespace Skobkin\Bundle\PointToolsBundle\Controller;
use Skobkin\Bundle\PointToolsBundle\Entity\Blogs\Post;
use Skobkin\Bundle\PointToolsBundle\Repository\Blogs\PostRepository;
2017-11-05 02:03:26 +00:00
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2016-03-24 22:10:10 +00:00
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Response;
2017-11-05 02:03:26 +00:00
class PostController extends AbstractController
2016-03-24 22:10:10 +00:00
{
/**
* @ParamConverter("post", class="SkobkinPointToolsBundle:Blogs\Post")
*
* @return Response
*/
public function showAction(Post $post, PostRepository $postRepository): Response
2016-03-24 22:10:10 +00:00
{
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
'post' => $postRepository->getPostWithComments($post->getId()),
2016-03-24 22:10:10 +00:00
]);
}
}