Created
December 4, 2017 17:36
-
-
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
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 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