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

"global_complete" add on

Discussion in 'XenForo Development Discussions' started by moman, Jan 5, 2012.

  1. moman

    moman Active Member

    I would like to apply a regular expression to the final XF output server-side, as you would on $output in global_complete in vBulletin. How would I accomplish this?
     
  2. Fuhrmann

    Fuhrmann Well-Known Member

    Use the code event listener front_controller_post_view. This code event pass the $output by reference, so you can change it.

    Called after the view has been executed, before outputting. This can be used to modify the final output.
    Callback signature:
    XenForo_FrontController $fc, &$output
    Arguments:
    1. XenForo_FrontController $fc - the front controller instance. From this, you can inspect the request, response, dependency loader, etc.
    2. string &$output - string to output. Note that this may not be HTML or even text.
     
    moman likes this.
  3. moman

    moman Active Member

    Thanks, worked like a charm. I was able to define the callback in the admin panel's development tab, and then I uploaded my php file and was good to go :)
     

Share This Page