public function returnToScreen($obj) { $format = strtolower($this->getParam('format', 'json')); if ($format == 'xml') { return $this->returnRaw(\DF\Export::ArrayToXml($obj), 'xml'); } else { return $this->returnRaw(json_encode($obj, \JSON_UNESCAPED_SLASHES), 'json'); } }