Reputation: 3523
I am coming from a Zend Framework background, and the process for creating a page is:
When you access the application via http://host/controller/action the view file is automatically rendered.
Is it possible for me to do this within Symfony2 so that I do not have to create routing entries for each controller/action? and automatically render the twig templates for each action?
Thanks in advance
Upvotes: 0
Views: 640
Reputation: 2464
You can use the @Template
annotation from the SensioFrameworkExtraBundle.
class MyController extends Controller {
/**
* @Template()
*/
public function myAction() {
return array();
}
}
The template is Resources/views/My/my.twig.html
. Note that you have to return something in the action method.
Upvotes: 1