Answer the question
In order to leave comments, you need to log in
How to use your service in Symfony 2 php template engine?
$foo = $this->get('foo');
This code works in the controller. However, if used in a php template engine, it gives
The helper "foo" is not defined.
services:
foo:
class: App\CoreBundle\Classes\Foo
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question