Beispiel #1
0
 /**
  * Renders a tree input.
  *
  * @return $this the field object itself
  */
 public function treeInput($options = [])
 {
     if (!$options['class']) {
         throw new Exception('Class name is missed');
     }
     $object = new $options['class']();
     $data = $object->getTreeData('')['children'];
     $input = '';
     $input .= '<div class="html-tree">';
     $input .= FieldHelper::buildHtmlTreeInput($this->model, $this->attribute, $data);
     $input .= '</div>';
     $this->parts['{input}'] = $input;
     return $this;
 }