Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
$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.