"global_complete" add on


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?


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


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 :)