/** * 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()); }
<?php require_once dirname(__FILE__) . '/../zframework/app/library/ui/JsUIComponentInterface.php'; require_once dirname(__FILE__) . '/../zframework/app/library/ui/jquery/JUIComponent.php'; require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/UIComponent.php'; require_once dirname(__FILE__) . '/../zframework/app/library/ui/jquery/Tab.php'; require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/components/TextElement.php'; require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/components/HtmlScript.php'; //put your code here $sf = new Tab('test'); $sf->addTab("x1", "x1"); $sf->addTab("d1", "d1"); $e = new TextElement("xy"); $e->setAttribute("name", "dddddddd"); $e->setLabel('ddd', 'sdfdsfdsfs', 'css'); //$sf->setAttribute("id", "test"); //$sf->setAttribute("target", "_blank"); $sf->setElement("x1", $e); $e1 = new HtmlScript(); $e1->setScript("<a herf='aa.html' target='_blank'>"); $sf->setElement('d1', $e1); $e2 = new TextElement("xy1"); $e2->setAttribute("name", "dddddddd11"); $e2->setLabel('ddd', 'sdfdsfdsfs1', 'css1'); $sf->setElement("d1", $e2); $e3 = new HtmlScript(); $e3->setScript("</a>"); $sf->setElement("d1", $e3); echo $sf->render();
/** * Erzeugt einen <script> Tag für die übergebene Bibliothek * @param string $libraryFile * @return Html|HtmlScript */ public static function createElement($libraryFile) { $result = new HtmlScript('script'); $result->addAttribute('src', $libraryFile); return $result; }