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

Clean way for json responses



What should i do, if i have a controllermethod, which returns only json data?

I've seen that xenforo is using "non existing templates for this.

For example:
return $this->responseView(
template member_autocomplete doesn't exist, but it's used in the responseView

i'm doing the same in my add-on, but it's IMHO a strange way^^.
Is there any way to return this without an pseudo view?
        else {
            return $this->responseView('Ragtek_Invite_ViewAdmin_Index', 'foo', $user);
        return $this->responseView('Ragtek_Invite_ViewAdmin_Index', 'foo', $params);


Well-known member
I would say it is there in case a mod or something wants to test for that template, more as a reference thing. In listeners etc.


XenForo developer
Staff member
The template can be used as a hint for the JSON output.

Or it is simply there if there is need for another view type which would output the template.