×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Pascual Muñoz
Added: Oct 28, 2016 7:00 PM
Views: 6
Tags: no tags
  1. <?php
  2.  
  3. namespace lacueva\BlogBundle\Controller;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  6. use lacueva\BlogBundle\Entity\Entries;
  7.  
  8. class DefaultController extends Controller
  9. {
  10.     public function indexAction()
  11.     {
  12.  
  13.                 $em = $this->getDoctrine()->getManager();
  14.                 $entry_repo = $em->getRepository('BlogBundle:Entries');
  15.                 $entries = $entry_repo->findAll();
  16.                
  17.                 $e = new \lacueva\BlogBundle\Entity\Entries;
  18.                 foreach ($entries as $e)
  19.                 {
  20.                         echo $e->getTitle();
  21.                 }
  22.                 die();
  23.                
  24.                
  25.                  //       return $this->render('BlogBundle:Default:index.html.twig');
  26.     }
  27. }