public function __construct($name, $caption, $value = NULL) { $id = 'form_field_' . self::$count++; $this->create_label($id, $caption); $this->input = html_tag::create('textarea'); $this->input->name = $name; $this->input->id = $id; $this->input->append($value); }
public function __construct($name, $caption, $options, $value = NULL) { $id = 'form_field_' . self::$count++; $this->create_label($id, $caption); $this->input = html_tag::create('select'); $this->input->name = $name; foreach ($options as $k => $v) { if ($value != $k) { $this->input->append('<option value="' . htmlspecialchars($k) . '">' . htmlspecialchars($v) . '</option>'); } else { $this->input->append('<option value="' . htmlspecialchars($k) . '" selected>' . htmlspecialchars($v) . '</option>'); } } }
public function add($title, $content = null) { $id = self::$tab_count++; $link = html_tag::create('a')->attr('href', '#tabs-' . $id)->append($title); $link->attr('data-toggle', 'tab'); $this->tabs->append(html_tag::create('li')->append($link)); $data = html_tag::create('div')->attr('id', 'tabs-' . $id); $data->class = 'tab-pane'; if ($content) { $data->append($content); } $this->content->append($data); return $data; }
public function __construct($name, $caption, $options, $value = NULL) { $this->label = html_tag::create('div')->append($caption); $this->label->class = 'form_label'; $this->input = array(); foreach ($options as $k => $v) { $id = 'form_field_' . self::$count++; $label = html_tag::create('label')->append($v); $label->for = $id; $input = html_standalone::create('input'); $input->type = 'radio'; $input->id = $id; $input->value = $k; $input->name = $name; if ($k == $value) { $input->checked = true; } $this->input[] = array($input, $label); } }
protected function create_label($id, $caption) { $this->label = html_tag::create('label')->append($caption); $this->label->for = $id; $this->label->class = 'control-label'; }
/** * Converts the object into html string * @return string */ public function __toString() { $this->append(html_tag::create('div')->attr('class', 'control-group')->append($this->buttons)); return parent::__toString(); }