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

Controller response as JSON

digitalpoint

Well-known member
#1
So I know I can set the response type to JSON, and I do get JSON output, but is there a way to output the params you pass to it? I feel like it's something simple, but the following doesn't work:
PHP:
$this->_routeMatch->setResponseType('json');
return $this->responseView('XenForo_ViewPublic_DraggableThreads_Move', 'foo', array('digitalpoint_test' => 'hello world!'));
I get JSON output, but I what I'm trying to do is include "digitalpoint_test" in the JSON array.