Volt Compiler is useful for templates outside of views. The "Stand-alone component" section of https://docs.phalconphp.com/en/3.0.0/reference/volt.html is a start. I eventually made the compiler work. Perhaps the Compiler could have a page by itself.
My use has some parallels to the discussion in https://forum.phalconphp.com/discussion/15855/render-html-email-template. I created a generic direct use of the volt compiler in a controller to test the concept. It works when I use files. It did not work when I tried to use strings. I might revisit that.
The first requirement is to isolate the processing of templates because they may be user summitted. Using the compiler direct does give me control of the variables presented. What I need next are things like the site name and the URL for references to pages on the site. I need to selectively add just a few items but from the Phalcon code to allow for any processing within Phalcon code before reaching the template code.
The next option is files/string. For a one off template, string processing avoids the overheads of file processing. For repeat use, I will use files to cache the compiled template. The string version would be used when a content editor is editing a template and wants to see the result. The repeat version would be after the edited template is saved. The compiled template could be retained until the template is edited and saved.
Has anyone used Volt Compiler like this? Any tips? Would a separate Volt Compiler page help?