public function testRender() { $id = 1; $name = "test"; $this->object->setName($name); $this->object->setHtmlValue("<div>xyz</div>"); $output = "<div name='test'><div>xyz</div></div>"; $this->assertEquals($output, $this->object->render()); }
public function testRender() { $id = 1; $name = "test"; $this->object->setId($id); $this->object->setName($name); $output = "<input id='1' name='test'>"; $this->assertEquals($output, $this->object->render()); }
public function testRender() { $id = 1; $name = "test"; $this->object->setLabel("textarea", "textarea", "css"); $this->object->setName($name); $output = "<div id='textarea' class='css'>textarea</div><textarea id='1' name='test'></textarea>"; $this->assertEquals($output, $this->object->render()); }
public function testRender() { $id = 1; $name = "test"; $this->object->setText("checkbox_abc"); $this->object->setName($name); $output = "<input id='1' type='checkbox' name='test'>checkbox_abc"; $this->assertEquals($output, $this->object->render()); }
/** * Generate HTML of the list <select> element for drop-down list. * * @param array<mixed> $dataSet List of drop-down options data. * @param string,integer $currentValue Current value if selected. * @param array<string => string> $attributesList List of the HTML attributes * for the drop-down element (optional). * @param string $template Path to the template file of the drop-down (optional). */ public function UIDropDown($dataSet = array(), $currentValue = null, $attributesList = array(), $template = "") { if (empty($template)) { $template = self::DEFAULT_TEMPLATE; } parent::UIComponent($attributesList, $template, $dataSet, $currentValue); }
public function UIButton($attribs = array(), $template = null, $show = false) { if (empty($template)) { $template = self::DEFAULT_TEMPLATE; } if ($show) { parent::UIComponent($attribs, $template); } else { $this->template = $template; $this->setAttributes($attribs); } }
/** * Generate HTML of the list <option> element. * * @param string,integer $optionValue Value of the option. * @param mixed $option Option object, pair array or single title value. * @param string,integer $currentValue Current selected list option value (optional). * @param string $template HTML template of this component (optional). */ public function UIListOption($optionValue, $option, $currentValue, $template = "") { if (empty($template)) { $template = self::DEFAULT_TEMPLATE; } if (isObject($option)) { parent::UIComponent(array('value' => $option->id, 'title' => $option->title), $template, array(), $currentValue); } elseif (is_array($option)) { parent::UIComponent($option, $template, array(), $currentValue); } else { parent::UIComponent(array('value' => $optionValue, 'title' => $option), $template, array(), $currentValue); } }
/** * Generated from @assert */ public function testRender() { $e = new TextElement("xy"); $e->setAttribute("name", "dddddddd"); $e->setLabel('ddd', 'sdfdsfdsfs', 'css'); $this->object->setAttribute("id", "test"); $this->object->setAttribute("target", "_blank"); $this->object->setElement($e); $e1 = new HtmlScript(); $e1->setScript("<a herf='aa.html' target='_blank'>"); $this->object->setElement($e1); $e2 = new TextElement("xy1"); $e2->setAttribute("name", "dddddddd11"); $e2->setLabel('ddd', 'sdfdsfdsfs1', 'css1'); $this->object->setElement($e2); $e3 = new HtmlScript(); $e3->setScript("</a>"); $this->object->setElement($e3); $output = "<form id='test' target='_blank'><div id='ddd' class='css'>sdfdsfdsfs</div><input id='xy' type='text' name='dddddddd'><a herf='aa.html' target='_blank'><div id='ddd' class='css1'>sdfdsfdsfs1</div><input id='xy1' type='text' name='dddddddd11'></a></form>"; $this->assertEquals($output, $this->object->render()); }
/** * Generate HTML of the list <input type="checkbox" ... /> element. * * @param array<string => string> $attributesList List of the component attributes. * @param string $template Path to the components template file. */ public function UICheckBox($attributesList, $template) { parent::UIComponent($attributesList, $template); }