Package Data | |
---|---|
Maintainer Username: | bluora |
Maintainer Contact: | rocco@hnh.digital (Rocco Howard) |
Package Create Date: | 2016-10-26 |
Package Last Update: | 2023-11-07 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-16 15:01:46 |
Package Statistics | |
---|---|
Total Downloads: | 4,296 |
Monthly Downloads: | 2 |
Daily Downloads: | 1 |
Total Stars: | 2 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Create HTML tags and render them efficiently.
Extends upon Airmanbzh/php-html-generator with some Laravel related integration.
return HtmlTag::createElement();
// returns an empty HtmlTag Container
return HtmlTag::createElement('a');
// returns an HtmlTag containing a 'a' tag
echo(HtmlTag::createElement('a'));
echo $html->tag('div')
// <div></div>
echo(HtmlTag::createElement('p')->text('some content'));
// <p>some content</p>
echo(HtmlTag::createElement('div')->addElement('a')->text('a text'));
// <div><a>a text</a></div>
$container = HtmlTag::createElement('div');
$container->addElement('p')->text('a text');
$container->addElement('a')->text('a link');
// <div><p>a text</p><a>a link</a></div>
$tag = $html->tag('a')
->set('href','./sample.php')
->set('id','myID')
->text('my link');
echo( $tag );
// <a href='./sample.php' id='myID'>my link</a>
$tag = $html->tag('div')
->id('myID');
echo( $tag );
// <div id='myID'>my link</a>
$tag = $html->tag('div')
->addClass('firstClass')
->addClass('secondClass')
->text('my content')
->removeClass('firstClass');
echo( $tag );
// <div class="secondClass">my content</div>
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.