Created
February 7, 2018 15:23
-
-
Save weaverryan/1578778d6f826f2d820e34e1f71ce863 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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