symfony - Twig template file not found in service -
rendering twig template inside controller works charm. have render template inside service, , won't work:
"unable find template file ..."
the service container-aware , has "container" injected.
i've tried different ways set template file:
$this->container->get('templating') ->render('appbundle:email:mytemplate.html.twig'); $this->container->get('templating') ->render('src/appbundle/resources/views/email/mytemplate.html.twig');
always same error... template file exists in /src/appbundle/resources/views/email/mytemplate.html.twig (double-checked!)
this controller call works:
$this->get('templating') ->render('appbundle:email:mytemplate.html.twig');
why won't work in service...?
Comments
Post a Comment