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

Are CELs just hooks?

Discussion in 'XenForo Development Discussions' started by TheJoker, Mar 5, 2013.

  1. TheJoker

    TheJoker Member

    I am just curious, are Code Event Listeners the same as hooks (as in other forumware)? If not, what's the difference between the two?
     
  2. Lawrence

    Lawrence Well-Known Member

    I'm not sure of other forum's hook system as I never gave them much thought. XenForo uses listeners so add-ons can extend or implement objects, and class instances.
     
  3. EQnoble

    EQnoble Well-Known Member

    No they can't be the same thing...there are hooks in the software and you can use a CEL as you put it to listen for a hook.

    If you have a document that you want loaded when a specific hook is encountered and it is located at:
    /library/microsuck/addon1/documentName.php ​
    you would create a template hook and set it to fire
    class: microsuck_addon1_documentName​
    with a method of :):)
    templateHook​

    in the documentName.php file you would create a function that fires when a particular hook name is come across



    hopefully that is not a completely horrible explanation
     

Share This Page