Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Xyl\Interpreter\Html\Document Class Reference
Inheritance diagram for Hoa\Xyl\Interpreter\Html\Document:

Public Member Functions

 preExecute ()
 
 postExecute ()
 
 getTitle ()
 
- Public Member Functions inherited from Hoa\Xyl\Interpreter\Html\Concrete
 construct ()
 
 readAttributes ()
 
 readAttribute ($name)
 
 attributeExists ($name)
 
 readAttributesAsList ()
 
 readAttributeAsList ($name)
 
 readCustomAttributes ($set)
 
 readCustomAttributesAsList ($set)
 
 readAttributesAsString ($compute=true)
 
 writeAttributes (Array $attributes)
 
 writeAttribute ($name, $value)
 
 writeCustomAttributes ($set, Array $pairs)
 
 removeAttribute ($name)
 
 getName ()
 
- Public Member Functions inherited from Hoa\Xyl\Element\Concrete
 computeDataBinding (Array &$data, Array &$parent=null)
 
 render (Stream\IStream\Out $out)
 
 computeValue (Stream\IStream\Out $out=null)
 
 computeTransientValue (Stream\IStream\Out $out=null)
 
 computeAttributeValue ($value, $type=self::ATTRIBUTE_TYPE_UNKNOWN, $name=null)
 
 isLastIteration ()
 
 setVisibility ($visibility)
 
 getVisibility ()
 
- Public Member Functions inherited from Hoa\Xml\Element\Concrete
 __construct (Element $abstract, Element $superRoot, Array $rank=[], $namespace=null)
 
 construct ()
 
 getAbstractElement ()
 
 getAbstractElementSuperRoot ()
 
 getName ()
 
 count ()
 
 getIterator ()
 
 __set ($name, Concrete $value)
 
 __get ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $element)
 
 offsetUnset ($offset)
 
 __call ($name, Array $arguments=[])
 

Protected Member Functions

 paint (Stream\IStream\Out $out)
 
 computeTitle ()
 
- Protected Member Functions inherited from Hoa\Xyl\Interpreter\Html\Concrete
 mapAttributes ()
 
- Protected Member Functions inherited from Hoa\Xyl\Element\Concrete
 selectData ($expression, Array &$bucket)
 
 getCurrentData ()
 
 paint (Stream\IStream\Out $out)
 
 cleanTransientValue ()
 
 formatValue ($value, $name=null)
 
 _formatValue ($value)
 
 computeFromString ($xyl)
 
 getDeclaredAttributes ()
 

Protected Attributes

 $_title = null
 
- Protected Attributes inherited from Hoa\Xyl\Interpreter\Html\Concrete
 $_htmlAttributes = []
 
 $_htmlAttributesType = []
 
 $_contentFlow = 2
 
- Protected Attributes inherited from Hoa\Xyl\Element\Concrete
 $_visibility = true
 
 $_transientValue = null
 
 $_lastIteration = false
 
- Protected Attributes inherited from Hoa\Xml\Element\Concrete
 $_name = null
 
 $_children = []
 
 $_iterator = []
 
 $abstract = null
 
 $_superRoot = null
 

Additional Inherited Members

- Static Public Member Functions inherited from Hoa\Xml\Element\Concrete
static getAbstractElementId (Element $element)
 
static getConcreteElement (Element $element)
 
static getAbstractElementSuperRootOf (Element $element)
 
- Public Attributes inherited from Hoa\Xyl\Element\Concrete
const ATTRIBUTE_TYPE_UNKNOWN = 0
 
const ATTRIBUTE_TYPE_NORMAL = 1
 
const ATTRIBUTE_TYPE_ID = 2
 
const ATTRIBUTE_TYPE_CUSTOM = 4
 
const ATTRIBUTE_TYPE_LIST = 8
 
const ATTRIBUTE_TYPE_LINK = 16
 
- Static Protected Member Functions inherited from Hoa\Xyl\Element\Concrete
static _getDeclaredAttributes ()
 
- Static Protected Attributes inherited from Hoa\Xyl\Interpreter\Html\Concrete
static $_attributesMapping = …
 
- Static Protected Attributes inherited from Hoa\Xyl\Element\Concrete
static $_attributes
 
- Static Protected Attributes inherited from Hoa\Xml\Element\Concrete
static $_store = []
 
static $_superRoots = []
 
static $_multiton = []
 

Detailed Description

Class .

The <document> component.

Definition at line 50 of file Document.php.

Member Function Documentation

Hoa\Xyl\Interpreter\Html\Document::computeTitle ( )
protected

Compute title.

Returns
void

Definition at line 163 of file Document.php.

164  {
165  $xpath = $this->xpath('./__current_ns:title');
166 
167  if (empty($xpath)) {
168  return;
169  }
170 
171  $this->_title = $this->getConcreteElement($xpath[0]);
172 
173  return;
174  }
static getConcreteElement(Element $element)
Definition: Concrete.php:212

Here is the call graph for this function:

Here is the caller graph for this function:

Hoa\Xyl\Interpreter\Html\Document::getTitle ( )

Get the <title> component.

Returns

Definition at line 181 of file Document.php.

182  {
183  return $this->_title;
184  }
Hoa\Xyl\Interpreter\Html\Document::paint ( Stream\IStream\Out  $out)
protected

Paint the element.

Parameters
\Hoa\Stream\IStream\Out$outOut stream.
Returns
void

Definition at line 67 of file Document.php.

68  {
69  $root = $this->getAbstractElementSuperRoot();
70 
71  $locale = $root->getLocale();
72  $language = null;
73 
74  if (null !== $locale) {
75  $language .= ' lang="' . $locale->getLanguage() . '"';
76  }
77 
78  $out->writeAll(
79  '<!DOCTYPE html>' . "\n\n" .
80  '<!--[if lt IE 7]><html class="ie6"><![endif]-->' . "\n" .
81  '<!--[if IE 7]><html class="ie7"><![endif]-->' . "\n" .
82  '<!--[if IE 8]><html class="ie8"><![endif]-->' . "\n" .
83  '<!--[if (gte IE 9)|!(IE)]>' . "\n" .
84  '<html' . $language . '>' . "\n" .
85  '<![endif]-->' . "\n" .
86  '<head>' . "\n"
87  );
88 
89  if (null !== $this->_title) {
90  $out->writeAll(' ');
91  $this->_title->render($out);
92  }
93 
94  $out->writeAll(
95  "\n" .
96  ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />' . "\n" .
97  ' <meta http-equiv="content-type" content="text/javascript; charset=utf-8" />' . "\n" .
98  ' <meta http-equiv="content-type" content="text/css; charset=utf-8" />' . "\n"
99  );
100 
101  foreach ($root->getMetas() as $meta) {
102  $out->writeAll(' <meta ' . $meta . ' />' . "\n");
103  }
104 
105  $stylesheets = $root->getStylesheets();
106 
107  if (!empty($stylesheets)) {
108  $out->writeAll("\n");
109 
110  foreach ($stylesheets as $href) {
111  $out->writeAll(
112  ' <link type="text/css" href="' . $href .
113  '" rel="stylesheet" />' . "\n"
114  );
115  }
116  }
117 
118  $out->writeAll(
119  '</head>' . "\n" .
120  '<body>' . "\n\n"
121  );
122 
123  foreach ($this as $child) {
124  if ('title' != $child->getName()) {
125  $child->render($out);
126  }
127  }
128 
129  $out->writeAll(
130  "\n\n" . '</body>' . "\n" . '</html>'
131  );
132 
133  return;
134  }

Here is the call graph for this function:

Hoa\Xyl\Interpreter\Html\Document::postExecute ( )

Post-execute an element.

Returns
void

Implements Hoa\Xyl\Element\Executable.

Definition at line 151 of file Document.php.

152  {
153  $this->computeTitle();
154 
155  return;
156  }

Here is the call graph for this function:

Hoa\Xyl\Interpreter\Html\Document::preExecute ( )

Pre-execute an element.

Returns
void

Implements Hoa\Xyl\Element\Executable.

Definition at line 141 of file Document.php.

142  {
143  return;
144  }

Member Data Documentation

Hoa\Xyl\Interpreter\Html\Document::$_title = null
protected

Definition at line 57 of file Document.php.


The documentation for this class was generated from the following file: