Loading…

How to create Controllers in Symfony2?

Controller's file default location is src/AppBundle/Controller Now you can create here your controller with below code.

Example

                                        

namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class YourControllerName extends Controller
{
}

 

Suggest An Answer

No suggestions avaliable!

Latest post from Symfony 2 interview questions

Ask Question