function render() { if (!$this->source_set) { if (!$this->model->loaded()) { throw $this->exception('Specified model must be loaded'); } $data = array(); foreach ($this->model->elements as $key => $field) { if ($field instanceof Field) { $data[] = array('id' => $key, 'name' => $field->caption(), 'value' => $field->get()); } } parent::setSource($data); } return parent::render(); }
function render() { if (!$this->source_set) { if (!$this->model->loaded()) { throw $this->exception('Specified model must be loaded'); } $data = array(); foreach ($this->model->getActualFields() as $key) { $field = $this->model->hasElement($key); if (!$field) { continue; } if ($field instanceof Field || $field instanceof Field_Base) { $data[] = array('id' => $key, 'name' => $field->caption(), 'value' => $field->get()); } } parent::setSource($data); } return parent::render(); }
function render() { if ($this->js_widget) { $fn = str_replace('ui.', '', $this->js_widget); $this->js(true)->_load($this->js_widget)->{$fn}($this->js_widget_arguments); } return parent::render(); }