Search code examples
phptwigsilexbolt-cms

template * is not defined () - Bolt CMS


I'm moving one of my Bolt 1.6 sites to 2.0 but I'm running into the following problem when trying to render a twig template for an email:

Code:

return $app['twig']->render($app['config']->get('general/template/email'));

Response:

Class: Twig_Error_Loader
Message: Template "twig/template/enquiry-email.twig" is not defined ().
Code: 0

The following code also produces the same result:

return $app['render']->render($template);

The template is defined in app/config.yml under the key template/email

I can confirm that the template definitely exists and was previously working in version 1.6. I've also tried it with other templates which work in other functions within the same class but it still produces the same result.

It also renders the template if I don't POST any parameters.

The code is being executed within my own controller (appController.php). Which renders other views without issue.

Any help would be greatly appreciated.


Solution

  • This issue was fixed in Bolt 2.1.0 - Github issue