Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Issue #75: Set the json output in the context
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens committed May 2, 2016
1 parent da9b1cd commit 932ea40
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions code/view/json.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,11 @@ protected function _actionRender(ViewContext $context)
protected function _fetchData(ViewContext $context)
{
$output = new \ArrayObject(array(
'jsonapi' => array(
'version' => $this->_version,
),
'links' => array(
'self' => $this->getUrl()->toString()
),
'jsonapi' => array('version' => $this->_version),
'links' => array('self' => $this->getUrl()->toString()),
'data' => array()
));

$model = $this->getModel();
$url = $this->getUrl();

Expand Down Expand Up @@ -189,7 +186,7 @@ protected function _fetchData(ViewContext $context)
$output['included'] = array_values($this->_included_resources);
}

$this->setContent($output);
$context->content = $output;
}

/**
Expand Down Expand Up @@ -265,7 +262,6 @@ protected function _includeResource(ModelEntityInterface $entity)
);
}


/**
* Creates resource objects and returns an array of resource identifier objects specified by JSON API
*
Expand Down

0 comments on commit 932ea40

Please sign in to comment.