src/Controller/BrandsController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use ApiPlatform\Core\Serializer\JsonEncoder;
  4. use App\Repository\BrandsRepository;
  5. use App\Repository\DeliveryPersonRepository;
  6. use App\Repository\OrdersInDeliveryRepository;
  7. use Doctrine\ORM\EntityManagerInterface;
  8. use Symfony\Component\Serializer\SerializerInterface;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\HttpFoundation\JsonResponse;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. class BrandsController extends AbstractController
  14. {
  15. public function indexAction(BrandsRepository $brands_repository) {
  16. $brands = $brands_repository->findAll();
  17. // dd($brands); die();
  18. return $this->render('@SyliusShop/Brands/index.html.twig',[
  19. 'brands' => $brands
  20. ]);
  21. }
  22. }