Overview

Namespaces

  • Tokamak
    • Dom

Classes

  • Tokamak\Dom\Component
  • Tokamak\Dom\Document
  • Tokamak\Dom\Element
  • Tokamak\Dom\HTMLDocument
  • Tokamak\Dom\Node
  • Overview
  • Namespace
  • Class
 1: <?php
 2: namespace Tokamak\Dom;
 3: 
 4: /**
 5:  * Class HTMLDocument
 6:  * @package Tokamak\Dom
 7:  * An HTML document template.
 8:  */
 9: abstract class HTMLDocument extends Document {
10:     public static $doctype = array("html", null, null);
11: 
12:     public function __construct (array $data = null, array $doctype = null){
13:         if(!isset($doctype)){
14:             $doctype = static::$doctype;
15:         }
16: 
17:         parent::__construct($data, $doctype);
18:     }
19: 
20:     /**
21:      * Render the document to an HTML string
22:      * @return string
23:      */
24:     public function __toString()
25:     {
26:         return $this->toHTML();
27:     }
28:     /**
29:      * Renders the document to an HTML string.
30:      * @return string
31:      */
32:     protected function toHTML(){
33:         return $this->dom->saveHTML();
34:     }
35: }
API documentation generated by ApiGen