• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not planned Allow compiler to be extended by load_class code event listener

Jon W

Well-known member
#1
Allowing XenForo_Template_Compiler and XenForo_Template_Compiler_Admin to be extended would allow template code to be manipulated by add-ons.

To do this would require only a small modification to the code in compileAndInsertParsedTemplate and compileParsedAdminTemplate methods of XenForo_Model_Template and XenForo_Model_AdminTemplate, respectively.

I am currently wanting to extend the compiler to add a hidden text input field to a whole bunch of text fields included in my templates in several add-ons, but at the moment I am having to copy huge chunks of code when I extend the above two models.

Thanks. :)
 

Mike

XenForo developer
Staff member
#2
I would say that manipulating the template compilers isn't something we want to encourage. They need to run without issue in the upgrade process where add-ons aren't involved.