Skip to content

Instantly share code, notes, and snippets.

@NandoKstroNet
Created December 4, 2017 17:36
Show Gist options
  • Save NandoKstroNet/44f3f7d65838a74e94ba115678dd7409 to your computer and use it in GitHub Desktop.
Save NandoKstroNet/44f3f7d65838a74e94ba115678dd7409 to your computer and use it in GitHub Desktop.
Controller criado no post sobre Symfony 4, no blod da Code Experts Learning em blog.codeexpertslearning.com.br
<?php
namespace App\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use App\Entity\Product;
class ProductController extends AbstractController
{
/**
* @Route("/", name="product_home")
*/
public function index()
{
$products = $this->getDoctrine()
->getRepository(Product::class)
->findAll();
var_dump($products);
return new Response('Welcome to your new controller!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment