2019-11-05 12:16:16 +01:00
|
|
|
<?php
|
|
|
|
|
2020-01-30 11:28:24 +01:00
|
|
|
namespace App\Controller;
|
2020-01-28 20:43:16 +01:00
|
|
|
|
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-28 20:43:16 +01:00
|
|
|
|
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-01-28 20:43:16 +01:00
|
|
|
|
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,
|
|
|
|
]);
|
|
|
|
}
|
2020-01-28 20:43:16 +01:00
|
|
|
|
2019-11-12 11:44:09 +01:00
|
|
|
|
2020-01-30 11:28:24 +01:00
|
|
|
}
|