Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jleagle/html-builder
HTML Builder
https://github.com/jleagle/html-builder
Last synced: 12 days ago
JSON representation
HTML Builder
- Host: GitHub
- URL: https://github.com/jleagle/html-builder
- Owner: Jleagle
- Created: 2014-08-09T10:48:45.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-28T22:12:49.000Z (almost 9 years ago)
- Last Synced: 2025-01-10T03:58:29.157Z (22 days ago)
- Language: PHP
- Homepage:
- Size: 73.2 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/)