public function output()
 {
     $data = $this->response->getData();
     $this->response->setContent(json_encode($data));
     $this->response->setContentType('application/json');
     parent::output();
 }
Ejemplo n.º 2
0
 public function output()
 {
     $data = $this->response->getData();
     $template = '<?xml version="1.0" encoding="UTF-8"?><person><name>%s</name><phone>%s</phone><address>%s</address></person>';
     $output = sprintf($template, $data['entityName'], $data['entityPhone'], $data['entityPhysicalAddress']);
     $this->response->setContent($output);
     $this->response->setContentType('text/xml');
     parent::output();
 }
 public function output()
 {
     $data = $this->response->getData();
     $template = '<b>Name: </b><span>%s</span><br><b>Phone: </b><span>%s</span><br><b>Address: </b><span>%s</span><br>';
     $output = sprintf($template, $data['entityName'], $data['entityPhone'], $data['entityPhysicalAddress']);
     $this->response->setContent($output);
     $this->response->setContentType('text/html');
     parent::output();
 }