PHP code example of webtheory / html
1. Go to this page and download the library: Download webtheory/html 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/ */
webtheory / html example snippets
use WebTheory\Html\Html;
use WebTheory\Html\Attributes\ClassList;
$age = 24;
$attributes = [
'id' => $age >= 21 ? 'real-id' : 'fake-id',
'class' => new ClassList(['dummy-class', 'dummy-class-2']),
];
$content = 'This is a test';
echo Html::tag('h1', $content, $attributes);