Shadab
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.
For example, here's a list which could be generated for the "post" template:
Code:
$canReply
$canViewIp
$post
$post.attachments
$post.canCleanSpam
$post.canDelete
$post.canEdit
$post.canInlineMod
$post.canLike
$post.ip_id
$post.like_date
$post.position
$post.post_date
$post.post_id
$post.username
$thread
$visitor.user_id
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.
Upvote
0