Skip to content

Instantly share code, notes, and snippets.

@mgallego
Created September 22, 2011 07:58
Show Gist options
  • Select an option

  • Save mgallego/1234273 to your computer and use it in GitHub Desktop.

Select an option

Save mgallego/1234273 to your computer and use it in GitHub Desktop.
<?php
namespace SFM\PicmntBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use SFM\PicmntBundle\Entity\Image;
use Symfony\Component\DependencyInjection\ContainerInterface;
class PaginatorController// extends Controller
{
protected $container;
public function __constructor(ContainerInterface $container){
$this->container = $container;
}
public function getContainer(){
return $this->container;
}
public function pruebaAction()
{
print('prueba: '.$this->getContainer());
$prueba = $this->getContainer()->get('request');
//$em = $this->container->get('doctrine')->getEntityManager();
//$em = static::createClient()->getContainer()->get('doctrine')->getEntityManager();
//$images = $em->getRepository('SFMPicmntBundle:Image')->findFirst('p.idImage DESC');
//$image = $images[0];
//print $image->getIdImage();
//return $image->getIdImage();
}
public function prueba2Action(){
$this->pruebaAction();
return 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment