<?php
// src/AppBundle/Controller/MyController.php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class MyController
{
/**
* @Route("/hello")
*/
public function myHelloAction()
{
return new Response(
'<html><body>
I\'m the response for request <b>/hello</b>
</body></html>'
);
}
}
NOTE: All controller classes should have ends with word 'Controller' and methods related to routs should ends with word 'Action'. Further, In which controller your Actions are placed is not relevant until you define a rout prefix for the controller.