Code: Select all
$form = new form("myform", "POST", "sample.php");Code: Select all
class form {
private $id;
private $method;
private $action;
private $content;
private $output;
public function __construct($id, $method, $action) {
$this->id = $id;
$this->method = $method;
$this->action = $action;
}
public function add_button($type, $value) {
$this->content .= "<input type=\"$type\" value=\"$value\"></input>";
}
public function create() {
$this->output = "<form id=\"".$this->id."\" method=\"".$this->method."\" action=\"".$this->action.">";
$this->output .= $this->content;
$this->output .= "</form>";
return($this->output);
}
public function __destruct() {
return(NULL);
}
}Code: Select all
$form->add_button('submit', 'submit');
$xsl->add_content($form->create());Code: Select all
Warning: DOMDocument::loadXML() [domdocument.loadxml]: attributes construct error in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Couldn't find end of Start Tag div line 1 in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Unescaped '<' not allowed in attributes values in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: attributes construct error in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Couldn't find end of Start Tag form line 1 in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: body line 1 and form in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: html line 1 and div in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: template line 1 and body in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Opening and ending tag mismatch: stylesheet line 1 and html in Entity, line: 1 in /var/www/html/home.php on line 28
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Extra content at the end of the document in Entity, line: 1 in /var/www/html/home.php on line 28Code: Select all
class xsl {
private $xsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
private $content;
public function add_content($var) {
$this->content .= $var;
}
public function output() {
$this->xsl .= "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" >";
$this->xsl .= "<xsl:template match=\"/\">";
$this->xsl .= "<html>";
$this->xsl .= "<head>";
$this->xsl .= "<title>Title</title>";
$this->xsl .= "</head>";
$this->xsl .= "<body>";
$this->xsl .= "<h1>H1: header here</h1>";
$this->xsl .= "<h2>H2: Menu</h2>";
$this->xsl .= "<h3>H3: Sub-menu options</h3>";
$this->xsl .= "<h4>H4: Page section identifiers</h4>";
$this->xsl .= "<div id=\"content\"".$this->content."</div>";
$this->xsl .= "<h5>H5: This page Copyright 2010, mysite.com</h5>";
$this->xsl .= "</body>";
$this->xsl .= "</html>";
$this->xsl .= "</xsl:template>";
$this->xsl .= "</xsl:stylesheet>";
return($this->xsl);
}
public function __destruct() {
return(NULL);
}
}Thanks in advance for any help/tips/pointers!