Google News
logo
Symfony - Interview Questions
How can we create a controller in Symfony2?
In Symfony, we can create controller by extending AbstractActionController class. For example :
use Zend\Mvc\Controller\AbstractActionController; 
use Zend\View\Model\ViewModel;      
   
class IndexController extends AbstractActionController {
   public function indexAction() {     
      return new ViewModel();     
   }     
}
Advertisement