1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00
date-poll-api/src/Controller/DefaultController.php

37 lines
802 B
PHP
Raw Normal View History

<?php
2020-01-30 11:28:24 +01:00
namespace App\Controller;
2020-01-30 11:28:24 +01:00
use App\Entity\Owner;
2020-10-26 11:39:04 +01:00
use App\Entity\Poll;
use App\Repository\PollRepository;
2020-04-14 18:09:03 +02:00
use App\Service\MailService;
2020-01-30 11:28:24 +01:00
use FOS\RestBundle\Controller\Annotations\Get;
use FOS\RestBundle\Controller\Annotations\Route;
2020-04-17 12:04:37 +02:00
use JMS\Serializer\Type\Exception\Exception;
2020-01-30 11:28:24 +01:00
use Symfony\Component\HttpFoundation\JsonResponse;
2020-04-17 12:04:37 +02:00
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
2020-01-30 11:28:24 +01:00
/**
* Class DefaultController
* @package App\Controller
2020-10-26 11:39:04 +01:00
* @Route("/page",name="api_")
2020-01-30 11:28:24 +01:00
*/
2020-04-16 17:11:01 +02:00
class DefaultController extends FramadateController {
2020-10-26 11:39:04 +01:00
/**
* @Get(path ="/",
* name = "page_home")
*/
public function indexAction() {
$polls = $this->getDoctrine()->getRepository( Poll::class )->findAll();
return $this->render( 'pages/home.html.twig',[
'polls' => $polls,
]);
}
2019-11-12 11:44:09 +01:00
2020-01-30 11:28:24 +01:00
}