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

Where to put a Function which both Callback and Controller use: Helper?

Discussion in 'XenForo Development Discussions' started by Marcus, Aug 12, 2015.

  1. Marcus

    Marcus Well-Known Member

    I have a function that both my Controller and my Callback need. Currently I copied it (and modified it a bit) to both areas. But that is not very convenient.

    The Callback can not use Addon_Controller_Actionfunction::myFunction, asI get the error this function is not static. And if it is static, it can not make use of getModelFromCache.

    Should I create a Addon_Helper_Action::myFunction and then use $getHelper('Addon_Helper_Action')->myFunction in both Controller and Callback?
  2. Marcus

    Marcus Well-Known Member

    any ideas?

Share This Page