コード例 #1
0
ファイル: ModelDetails.php プロジェクト: TigerBui/atk4
 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();
 }
コード例 #2
0
ファイル: ModelDetails.php プロジェクト: easyconn/atk4
 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();
 }
コード例 #3
0
 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();
 }