cakephp / twig-view

Twig View for CakePHP
MIT License
13 stars 7 forks source link

Manually search template paths for files loaded outside View functions #52

Closed othercorey closed 4 years ago

othercorey commented 4 years ago

Trying to re-use the internal Twig template searching puts unwanted restrictions on file paths. When extending twig templates, we often have base templates in the root directory not in the Controller directory. View automatically sets the templatePath to the Controller name.

Always load twig templates relative to the root template paths.

This is the expected behavior coming from legacy TwigView as well. This was missed in unit tests because we don't build TwigView through ViewBuilder from a Controller which automatically add the config.