Пример #1
0
 public function render()
 {
     $properties = array('message' => $this->message, 'code' => $this->code);
     if (ini_get('display_errors')) {
         $properties['data'] = array('file' => $this->file, 'line' => $this->line, 'function' => $this->function, 'class' => $this->class, 'args' => $this->args, 'info' => $this->info);
     }
     $content = json_encode(array('version' => '1.0', 'errors' => array($properties)));
     $this->setContent($content);
     return parent::render();
 }
Пример #2
0
 public function render()
 {
     $model = $this->getModel();
     if (Library\StringInflector::isPlural($this->getName())) {
         $data = array('settings' => $model->getRowset()->toArray());
     } else {
         $data = $model->getRow()->toArray();
     }
     $this->setContent($data);
     return parent::render();
 }