I'd like to add a new template compiler function,
But I can't find an easy way to call this: The classname is hardcoded in the container,
Am I missing smth. obvious?
I could overwrite the container via
Ideally I'd appreciate if
Nevermind, I should just read the comments
\XF\Template\Compiler::setFunction()
seems to be able to do that.But I can't find an easy way to call this: The classname is hardcoded in the container,
\XF\Service\Template\Compile::recompile()
gets the container and immediately uses it afterwards and there are also does not seem to be any code events that could be used.Am I missing smth. obvious?
I could overwrite the container via
app_setup
, but that feels really hacky and isn't quite extendable.Ideally I'd appreciate if
- The container would use an extended class instead of hardcoding
Template\Compiler
\XF\Template\Compiler::setFunction()
and\XF\Template\Compiler::setTag()
would use an extended class instead of hardcoding- There were code events in
\XF\Template\Compiler::setDefaultFunctions()
and\XF\Template\Compiler::setDefaultTags()
Nevermind, I should just read the comments
// We do not recommend trying to extend this class or the tags/functions it defines. Doing so may interfere
// with the upgrade process. If you must do so, it should not be part of an add-on. It should be done
// unconditionally via config.php. However, do so at your own peril as the worst case would potentially be
// an un-upgradeable installation.
Last edited: