-
Notifications
You must be signed in to change notification settings - Fork 0
/
GalleryImagesController.php
30 lines (23 loc) · 1.09 KB
/
GalleryImagesController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace LaSalle\Rendimiento\JudithVilela\ImageRegister\Infrastructure\Controller;
use LaSalle\Rendimiento\JudithVilela\ImageRegister\Application\ViewImage\ViewImage;
use LaSalle\Rendimiento\JudithVilela\ImageRegister\Infrastructure\Persistence\Repository\RedisCacheRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use LaSalle\Rendimiento\JudithVilela\ImageRegister\Infrastructure\Persistence\Repository\MySQLImageRegisterRepository;
final class GalleryImagesController extends AbstractController
{
/** @var ViewImage */
private $viewImage;
public function __construct(ViewImage $viewImage)
{
$this->viewImage = $viewImage;
}
/** @Route("/gallery", name="gallery", methods={"POST"}) */
public function gallery()
{
$this->viewImage->__construct(new MySQLImageRegisterRepository(), new RedisCacheRepository());
$images = $this->viewImage->__invoke();
return $this->render('gallery/gallery.html.twig', ['images' => $images] );
}
}