src/Controller/IndexController.php line 22
<?php
namespace App\Controller;
use App\Entity\Project;
use App\Repository\ProjectRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
class IndexController extends AbstractController
{
private $ProjectRepo;
public function __construct(ProjectRepository $ProjectRepo)
{
$this->ProjectRepo = $ProjectRepo;
}
public function index(): Response
{
$Projects = $this->ProjectRepo->findAllOnline();
$Project_slice = array_slice($Projects, 0, 4);
// //shuffle($images);
// $home_images = array_slice($images, 0, 20);
return $this->render('index.html.twig', ['projects' => $Project_slice]);
}
}