Lack of interest List of variables *used* in a Template


Well-known member
I'd love to see a feature (in debug mode only) that would allow developers to check which variables are *used* when rendering a template. This would come in very handy when we want to reuse default xenforo templates in our own applications; so we can easily know the bare minimum data (parameters) required to render a template.

For example, here's a list which could be generated for the "post" template:
I know it's almost impossible to list all the variables required for rendering a template; when you take into account template helpers, hooks and nested templates. But listing the immediate variable usage (nested templates not included) would still be nice. :)


Well-known member
Thanks Jake. (I had even liked the post!)

A lot of times, the variables that a particular template *uses* is actually a small subset of variables *available* to it. Checking the controller which injects the variable parameters, or dumping the data gives us the variable's availability. But the only way to know if that variable is used is to check the template itself; which can be a bit tedious in case of large templates like thread_view & its associated templates.


XenForo developer
Staff member
We are fairly judicious in our exposure of variables to templates. I would take it that if a variable is exposed via $viewParams in the responseView(), it is required by the template named, or that we intend for it to be used in the future.