PHP code example of joas8211 / html-composition
1. Go to this page and download the library: Download joas8211/html-composition 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/ */
joas8211 / html-composition example snippets
use HtmlComposition\HtmlComposition;
echo (new HtmlComposition)
->document()
->tag('html', ['lang' => 'en'])
->tag('head')
->tag('title')->text('Example Document')->end()
->end()
->tag('body')
->tag('h1')->text('Hello World!')->end()
->tag('img', [
'src' => 'https://picsum.photos/768/432',
'alt' => '',
], true)
->end()
->end();