mirror of
https://github.com/Mibew/CanteenHTML5.git
synced 2025-02-10 15:51:07 +03:00
43 lines
819 B
PHP
43 lines
819 B
PHP
<?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:
|
|
*
|
|
* $div = html('fragment');
|
|
*
|
|
* @class Fragment
|
|
* @extends NodeContainer
|
|
* @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;
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|