src/Controller/IndexController.php line 22

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Project;
  4. use App\Repository\ProjectRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Twig\Environment;
  8. class IndexController extends AbstractController
  9. {
  10.     private $ProjectRepo;
  11.     public function __construct(ProjectRepository $ProjectRepo)
  12.     {
  13.         $this->ProjectRepo $ProjectRepo;
  14.     }
  15.     public function index(): Response
  16.     {
  17.         $Projects $this->ProjectRepo->findAllOnline();
  18.         $Project_slice array_slice($Projects04);
  19.         // //shuffle($images);
  20.         // $home_images = array_slice($images, 0, 20);
  21.         return $this->render('index.html.twig', ['projects' => $Project_slice]);
  22.     }
  23. }