/**
* Transforms the value view variable to a serializable
* array represantion using a YAML view configuration and JSON encodes
* the result.
*
* @return string The JSON encoded variables
* @api
*/
public function render()
{
$this->controllerContext->getResponse()->setHeader('Content-Type', 'application/json');
$propertiesToRender = $this->renderArray();
$options = $this->getOption('jsonEncodingOptions');
return json_encode($propertiesToRender, $options);
}