Advertisement
Device-Cheat

symfony tfu

Apr 22nd, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. namespace BlogBundle\Controller;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  7.  
  8. class WpisController extends Controller
  9. {
  10. /**
  11. * @param int $id
  12. * @return \Symfony\Component\HttpFoundation\Response
  13. */
  14. public function indexAction($id)
  15. {
  16. $repository = $this->getDoctrine()->getRepository('BlogBundle:Wpis');
  17. $post = $repository->find($id);
  18. if ($post === null) {
  19. throw $this->createNotFoundException();
  20. }
  21. return $this->render('BlogBundle:Wpis:show.html.twig', ['post'=>$post]);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement