JsonOutput.class.php (349B)
1 <?php 2 3 namespace cms\output; 4 5 use cms\output\APIOutput; 6 use util\json\JSON; 7 8 /** 9 * JSON Rendering. 10 */ 11 class JsonOutput extends APIOutput 12 { 13 /** 14 * Renders the output in JSON Format. 15 */ 16 protected function renderOutput( $data ) 17 { 18 return JSON::encode($data); 19 } 20 21 public function getContentType() 22 { 23 return 'application/json'; 24 } 25 }