openrat-cms

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

YamlOutput.class.php (362B)


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