コード例 #1
0
 public static function quickOutput($a_data)
 {
     $d = new ZJsonDocument();
     $d->setData($a_data);
     $d->output();
     unset($d);
 }
コード例 #2
0
 public function onOutput()
 {
     if (!$this->request->isAjax()) {
         return;
     }
     $doc = null;
     if ($this->request->isJson()) {
         $doc = new ZJsonDocument();
         $doc->setData($this->application->getReturn());
     }
     if ($this->request->isXml()) {
         $doc = new ZXmlDocument();
         $doc->setData($this->application->getReturn());
     }
     if (!$doc) {
         $doc = new ZDocument();
     }
     $this->response->setDocument($doc);
     $this->response->addHeader('X-Response-With', 'XML Http Resquest Plugin');
 }