public function display() { $model = $this->getModel(); if (KInflector::isPlural($this->getName())) { $data = array('settings' => $model->getList()->toArray()); } else { $data = $model->getItem()->toArray(); } $this->output = $data; return parent::display(); }
/** * Renders and echo's the views output wrapping it in a js callback if present * * @return string JSON data */ public function display() { if (!KRequest::has('get.callback')) { return parent::display(); } $callback = KRequest::get('get.callback', 'cmd'); $json = $callback . '('; $json .= parent::display(); //Set the correct mime type $this->_document->setMimeEncoding('application/javascript'); $json .= ');'; return $json; }
public function display() { $model = $this->getModel(); if(KInflector::isPlural($this->getName())) { $data = $this->_getList($model); } else { $data = $this->_getItem($model); } $this->output = $data; return parent::display(); }