public function html() { if ($this->label) { $output = HTML::table()->class('form-table drone-group'); $tbody = $output->addNew('tbody'); } else { $output = $tbody = HTML::make(); } foreach ($this->childs as $child) { if (!$child->isIncluded()) { continue; } else { if ($child->isGroup() && !$child->label) { $tbody->add($child->html()); } else { $row = HTML::tr()->class('drone-row')->valign('top'); if ($child->isOption() && $child->isError()) { $row->addClass('drone-error'); } if ($child->isOption() && $child->indent) { $row->addClass('drone-indent'); } if ($child->label) { $row->addNew('th')->class('drone-label')->scope('row')->addNew('label')->add($child->label); } $option = $row->addNew('td')->colspan(!$child->label ? 2 : null)->addNew('div')->class('drone-option'); if ($child->owner instanceof Option) { $option->attr(array('data-drone-owner' => $child->owner->input_name, 'data-drone-owner-value' => json_encode((array) $child->owner_value))); } $option->add($child->html()); if ($child->description) { $option->addNew('p')->class('description drone-description')->add($child->description); } $tbody->add($row); } } } return $output; }