Example #1
0
 function render($r = self::RETURN_TYPE_JSON)
 {
     if ($r == self::RETURN_TYPE_XML) {
         header('Content-Type: application/xml');
         echo XmlSerializer::serialize($this->data);
     } else {
         header('Content-Type: application/json');
         echo json_encode($this->data);
     }
 }
Example #2
0
 function serialize()
 {
     return XmlSerializer::serialize($this);
 }