Injecting Twig as a service in Symfony2

后端 未结 2 1531
-上瘾入骨i
-上瘾入骨i 2020-12-15 17:38

Instead of extending the standard controller, I\'d like to inject Twig into one of my classes.

Controller:

namespace Project\\SomeBu         


        
2条回答
  •  失恋的感觉
    2020-12-15 18:22

    1. Try clearing your cache.

    2. Is your route set up to refer to the controller as a service? If not, Symfony won't utilize the service definition, and therefore any arguments you specify.

提交回复
热议问题