Tutorial by Examples

By default, all the controllers you generate with Symfony's built-in generate:controller command will make use of Symfony annotations for routing: namespace AppBundle\Controller; // You have to add a use statement for the annotation use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; ...
Instead of annotations, you can also specify your routes as YAML: app_index: path: /index defaults: { _controller: AppBundle:Acme:index } The same options apply to both annotations and YAML configurations. To import a YAML routing configuration in your root routing configuration, you d...

Page 1 of 1