29 lines
861 B
PHP
29 lines
861 B
PHP
|
<?php
|
||
|
|
||
|
namespace Skobkin\Bundle\PointToolsBundle\Controller;
|
||
|
|
||
|
use Skobkin\Bundle\PointToolsBundle\Entity\Blogs\Post;
|
||
|
use Skobkin\Bundle\PointToolsBundle\Service\UserApi;
|
||
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||
|
use Symfony\Component\HttpFoundation\Response;
|
||
|
|
||
|
class PostController extends Controller
|
||
|
{
|
||
|
/**
|
||
|
* @ParamConverter("post", class="SkobkinPointToolsBundle:Blogs\Post")
|
||
|
*
|
||
|
* @return Response
|
||
|
*/
|
||
|
public function showAction(Post $post)
|
||
|
{
|
||
|
$userApi = $this->container->get('skobkin_point_tools.api_user');
|
||
|
|
||
|
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
|
||
|
'post' => $post,
|
||
|
'avatar_url' => $userApi->getAvatarUrl($post->getAuthor(), UserApi::AVATAR_SIZE_LARGE),
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
}
|