I tried to use
# app/config/services.yml services: project.controller.some: class: Project\SomeBundle\Controller\SomeController arguments: ['@templating'] and
namespace Project\SomeBundle\Controller; use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; use Symfony\Component\HttpFoundation\Response; class SomeController { private $templating; public function __construct(EngineInterface $templating) { $this->templating = $templating; } public function indexAction() { return $this->templating->render( 'SomeBundle::template.html.twig', array( ) ); } } in Symfony 4 flex. Now I get the error
ServiceNotFoundException The service "project.controller.some" has a dependency on a non-existent service "templating". Please tell me how to solve this. My composer.json already contains "symfony/templating": "^4.0" but this seems not to be enough.