The template engine assumes that the site template is stored as XSLT, and the data is transmitted as generated XML:
$viewFile = /*...*/'.xsl'; $this->xml = new DomDocument(); $this->xml->appendChild($this->xml->createElement('page')); $xsl = new DomDocument(); $xsl->load($viewFile); $proc = new XSLTProcessor(); $proc->importStylesheet($xsl); return $proc->transformToXML($this->xml); generated on output:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> How to make a standard HTML5 header
<!DOCTYPE html> <html> without resorting to str_replace () before return and similar constructs?