howlowck/html-builder

There is no license information available for the latest version (dev-master) of this package.

dev-master 2014-01-08 22:37 UTC

This package is not auto-updated.

Last update: 2024-11-18 15:18:53 UTC


README

Include the Builder

use Howlowck\HtmlBuilder\Element;

Create Element

$form = new Element('form');

Add/Set Content

You can add a string. $form->addContent('welcome!')

Or another element

$firstName = new Element('input');
$form->addContent($firstName);

Add/Set Attributes

You can set attributes or properties. The order is the order you add them.

$first_name->addAttribute('required');
$first_name->addAttribute(array('id'=>'first_name'));

Get HTML

$form->getHtml();