File modules/cms/output/JsonOutput.class.php
Last commit: Sat Oct 17 01:14:30 2026 +0200 Jan Dankert New: Using a structured class for the API-Response. The output for GET-Requests is now without the "output" layer.
1 <?php 2 3 namespace cms\output; 4 5 use util\json\JSON; 6 7 /** 8 * JSON Rendering. 9 */ 10 class JsonOutput extends APIOutput 11 { 12 /** 13 * Renders the output in JSON Format. 14 */ 15 protected function renderOutput(array $data ): string 16 { 17 return JSON::encode($data); 18 } 19 20 public function getContentType(): string 21 { 22 return 'application/json'; 23 } 24 }
Downloadmodules/cms/output/JsonOutput.class.php
History Sat, 17 Oct 2026 01:14:30 +0200 Jan Dankert New: Using a structured class for the API-Response. The output for GET-Requests is now without the "output" layer. Tue, 14 Jan 2025 01:57:51 +0100 Jan Dankert Cleanup: Imports. 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 "/".