src/Controller/Catalog/Util/CategoryController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Catalog\Util;
  3. use App\Controller\BaseController;
  4. use App\Entity\Category;
  5. use App\Entity\Product;
  6. use Doctrine\ORM\Query\Expr\Base;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\HttpFoundation\Response;
  10. class CategoryController extends BaseController
  11. {
  12.     /**
  13.      * @return Response
  14.      */
  15.     public function renderCategories() {
  16.         $categories $this->getDoctrine()->getRepository(Category::class)->findAllCategories();
  17.         return $this->render('catalog/page/category-list.htm.twig', [
  18.             'categories' => $categories
  19.         ]);
  20.     }
  21. }