protected $supportedMediaTypes = ['application/json', 'text/html' ];
return json_encode($dashboard);
或者使用JSON View
/**
* @var string
*/
protected $viewFormatToObjectNameMap = array(
'html' => 'TYPO3\Fluid\View\TemplateView',
'json' => 'TYPO3\Flow\Mvc\View\JsonView'
);
...
$this->view->assign('value', $dashboard);