1. 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

Discussion in 'Closed Suggestions' started by Jon W, Jul 15, 2015.

  1. Jon W

    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. :)
  2. Mike

    Mike XenForo Developer Staff Member

    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.
  3. Jon W

    Jon W Well-Known Member

    Good point. Never thought of that. Thanks!

Share This Page