Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/donquixote/htmltag

PHP library to generate html tags and attribute strings
https://github.com/donquixote/htmltag

Last synced: 7 days ago
JSON representation

PHP library to generate html tags and attribute strings

Awesome Lists containing this project

README

        

# HtmlTag

A PHP library to generate HTML tags and attribute strings.

## Development status

I still need to fine-tune the API..
Feedback is welcome.

## Similar libraries

Have a look at https://github.com/thecodingmachine/html.tags

## Usage

PHP code:

$attributes = (new HtmlAttributes())
->set('id', 'theId')
->addClass('theClass')
->addStyle('color', 'green')
;
print $attributes->DIV('contents') . "\n";
print $attributes->HR(NULL) . "\n";
print '

text in a span
';

Resulting HTML:

contents



text in a pre