File modules/cms/output/PHPArrayOutput.class.php
Last commit: Mon Jan 31 00:00:48 2022 +0100 dankert Some documentation...
1 <?php 2 3 namespace cms\output; 4 5 use cms\output\APIOutput; 6 use util\json\JSON; 7 8 /** 9 * Rendering as PHP array. 10 */ 11 class PHPArrayOutput extends APIOutput 12 { 13 /** 14 * Renders the output in JSON Format. 15 */ 16 protected function renderOutput( $data ) 17 { 18 header('Content-Type: application/json; charset=UTF-8'); 19 return JSON::encode($data); 20 } 21 22 public function getContentType() 23 { 24 return 'application/php-array'; 25 } 26 }
Downloadmodules/cms/output/PHPArrayOutput.class.php
History Mon, 31 Jan 2022 00:00:48 +0100 dankert Some documentation... Sun, 30 Jan 2022 23:38:42 +0100 dankert Refactoring: Only 1 http-endpoint for both the UI and the API. Path "/api" is not available any more, all API data is served under "/".