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

Jon W

Well-known member
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. :)
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
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.
 
Top Bottom