openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

PHPArrayOutput.class.php (425B)


      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 }