Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jleagle/html-builder

HTML Builder
https://github.com/jleagle/html-builder

Last synced: 12 days ago
JSON representation

HTML Builder

Awesome Lists containing this project

README

        

# html-builder

A package to create clean HTML

### Usage

Create elements using their class:

```php
$div = new Div();
$image = new Img('http://example.com/img.png);
```

Each class has different constructor parameters to help you create the element:

```php
$abbr = new Abbr('WIFI', 'Wireless Fidelity');
```

Which returns `WIFI`

And helper methods to do common tasks:

```php
$ul = new Ul();
foreach([1, 2, 3] as $v)
{
$li = new Li('item '.$v);
$ul->addListItem($li);
}
```

Which will echo

```html


  • item 1

  • item 2

  • item 3


```

### Credits
Tag structure taken from [![/u/brianjenkins94](https://www.reddit.com/r/webdev/comments/3yl9yc/i_created_an_html5_mindmap_would_anyone_mind/)