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

"global_complete" add on

moman

Active member
#1
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?
 

Fuhrmann

Well-known member
#2
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

Active member
#3
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 :)