Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/donquixote/htmltag
- Owner: donquixote
- License: mit
- Created: 2014-07-21T01:13:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-21T01:17:32.000Z (over 10 years ago)
- Last Synced: 2023-03-10T21:13:00.677Z (over 1 year ago)
- Language: PHP
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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