PHP code example of setono / html-element
1. Go to this page and download the library: Download setono/html-element library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
setono / html-element example snippets
use Setono\HtmlElement\HtmlElement;
echo (new HtmlElement('p', 'Lorem ipsum'))->render(); // output: <p>Lorem ipsum</p>
echo HtmlElement::p('Lorem ipsum')->render(); // output: <p>Lorem ipsum</p>
$outer = HtmlElement::div()->withClass('container');
$inner = HtmlElement::div('Layout');
echo $outer->append($inner)->render(); // output: <div class="container"><div>Layout</div></div>