Make protected Templater functions public

Arty

Well-known member
XF/Template/Templater class cannot be extended, so the only way to add custom template tags is to write custom version of Templater class.

Custom tags require a lot of code that already exists in Templater class, but those functions are protected. Can you change protected functions to public?

In my custom tags I've needed the following functions so far that I've cloned: addToClassAttribute, assignFormControlId, processDynamicAttributes, processUnhandledAttributes.
 
Upvote 0
Oh, actually Templater can be extended

I know what went wrong: XF\Template\Compiler class cannot be extended, so I incorrectly assumed that other classes related to template compiler cannot be extended as well.

Sorry. Ignore this.
 
Top Bottom