HtmlObject

HtmlObject (in TS\WonderfulRelations\System\Renderer\HtmlObject) is the base form of any object the template renderer produces. All other renderer DTOs (button, modal, table, …) ultimately serialize to an HtmlObject tree.

Parameters

  • tag = string
  • attributes = array()
  • text = string, default ”
new HtmlObject($tag, $attributes, $text);

Usage

$object = new HtmlObject('span', array('class' => 'btn'), 'Click');
echo $object->get_template();

Output

<span class="btn">Click Me</span>