const mixinafEfanXtra::TemplateDirectories
afEfanXtra::TemplateDirectories
(Service) - Contribute directories that may contain efan / slim templates.
By contributing to TemplateDirectories
you can force efanXtra
to look in specified directories when searching for efan templates.
using afIoc using afEfanXtra class AppModule { @Contribute { serviceType=TemplateDirectories# } static Void contributeTemplateDirs(Configuration config) { config.add(`etc/components/`) } }
Templates could, of course, just be placed in resource directories inside your pod.
But hosting templates in directories external to the pod has the advantage of that during development, the pod does not need to be re-built and your application re-started just to see template changes.
Note that directories are not searched recursively, if you place templates in both etc/components/
and etc/components/admin/
then you would need to add them both:
config.add(`etc/components/`) config.add(`etc/components/admin/`)
Also, directory uris need to end with a /slash/.