public function execute(ActionResultContext $context) { $result = new ContentResult(json_encode($this->data), 'application/json'); return $result->execute($context); }
/** * @param array $json data to be presented in JSON */ function __construct(array $json) { parent::__construct(json_encode($json)); }