2016-03-24 22:10:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Skobkin\Bundle\PointToolsBundle\Controller;
|
|
|
|
|
|
|
|
use Skobkin\Bundle\PointToolsBundle\Entity\Blogs\Post;
|
2017-11-05 01:42:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2017-11-05 01:42:08 +00:00
|
|
|
public function showAction(Post $post, PostRepository $postRepository): Response
|
2016-03-24 22:10:10 +00:00
|
|
|
{
|
|
|
|
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
|
2017-11-05 01:42:08 +00:00
|
|
|
'post' => $postRepository->getPostWithComments($post->getId()),
|
2016-03-24 22:10:10 +00:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|