A very quick post as I couldn’t find anything documenting this yet (I will submit this to the docs also). If you want to use the combination of annotations for routing and also make your controllers into services then you can by specifying the service id in the class route:
<?php namespace ExampleBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; //-- /** @Route("/example", service="example_bundle.controller.example_controller") */ class ExampleController { //-- }
Whether you should make controllers services is a while different matter and I am going to stay away from that can of worms (at least for today).
Related posts:



Nice, maybe create a PR to the docs?
As above, I intend to
missed that. proceed
Nice, actions as controllers is the way to go (at least for me). Missed that topic a bit in your (otherwise great) talk at sfdaycgn. But I guess that aimed more towards beginners.