aData; } /** * @param array $aData * * @return $this */ public function SetData(array $aData) { $this->aData = $aData; return $this; } /** * @param array $aDataRow * * @return $this */ public function AddData(array $aDataRow) { $this->aData[] = $aDataRow; return $this; } public function output() { $this->add_header('Content-type: application/json'); foreach ($this->a_headers as $s_header) { header($s_header); } $aScripts = array_merge($this->a_init_scripts, $this->a_scripts, $this->a_ready_scripts); $aJson = [ 'data' => $this->aData, 'scripts' => $aScripts, ]; echo json_encode($aJson); } }