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

39 lines
836 B
PHP
Raw Normal View History

<?php
namespace App\Controller;
use FOS\RestBundle\Controller\Annotations\Get;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/**
* Class DefaultController
* @package App\Controller
* @Route("/api",name="api_")
*/
class DefaultController extends AbstractController {
/**
* @Get(path ="/",
* name = "app_get_default")
*/
public function index() {
return $this->json( [
'message' => 'Welcome to your new controller!',
'path' => 'src/Controller/DefaultController.php',
] );
}
/**
* @Get(
* path = "/my-polls",
* name = "app_get_my_polls",
* requirements = {"access_token"="\w+"}
* )
*/
public function showMyPollsAction() {
return $this->json( [
'message' => 'here are your polls',
] );
}
}