2014-11-10 13:42:53 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @module Canteen\HTML5
|
|
|
|
*/
|
|
|
|
namespace Canteen\HTML5
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Represents a set of HTML tags without a wrapper.
|
|
|
|
* Do not initiate this class directly, use the `html()` function:
|
|
|
|
*
|
2014-11-11 01:42:23 +03:00
|
|
|
* $div = html('fragment');
|
2014-11-10 13:42:53 +03:00
|
|
|
*
|
2014-11-11 01:42:23 +03:00
|
|
|
* @class Fragment
|
|
|
|
* @extends NodeContainer
|
2014-11-10 13:42:53 +03:00
|
|
|
* @constructor
|
|
|
|
* @param {Node|Array} [children=null] The collection of children or single child
|
|
|
|
*/
|
|
|
|
class Fragment extends NodeContainer
|
|
|
|
{
|
|
|
|
public function __construct($children = null)
|
|
|
|
{
|
|
|
|
parent::__construct('fragment', $children, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write to HTML
|
|
|
|
* @method __toString
|
|
|
|
* @return {String} The string representation of this HTML node
|
|
|
|
*/
|
|
|
|
public function __toString()
|
|
|
|
{
|
|
|
|
$buffer = '';
|
|
|
|
foreach($this->getChildren() as $child)
|
|
|
|
{
|
|
|
|
$buffer .= $child->__toString();
|
|
|
|
}
|
|
|
|
return $buffer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|