Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
namespace App\Controller;
use App\Repository\ProdutoRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ProdutoController extends Controller
{
/**
* @Route("/produto", name="produto")
*/
public function index(ProductoRepository $repo)
{
$em = $this
->getDoctrine()
->getManager();
$produtos = $repo->findAll();
return $this->render("produtos/index.html.twig", ['produtos' => $produtos]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.