<?php
// Include Composer Autoloader.
require_once __DIR__ . '/../vendor/autoload.php';
use ABGEO\HTMLGenerator\Document;
use ABGEO\HTMLGenerator\Element;
use ABGEO\HTMLGenerator\Exception\InvalidDocumentException;
$document = new Document();
$element = new Element();
try {
$container = Element::createDiv(
Element::createDiv(
Element::createDiv(
Element::concatenateElements(
Element::createHeading('Hello, World!', 1, ['mt-5']),
Element::createParagraph(
'This is simple Bootstrap 4 page', ['lead']
),
Element::createList(
[
Element::concatenateElements(
'Generated By ',
Element::createLink(
'gen-html',
'https://github.com/ABGEO07/gen-html/commits/master',
Element::TARGET_BLANK
), '.'
)
], Element::LIST_UNORDERED, ['list-unstyled']
)
),
['col-lg-12', 'text-center']
),
['row']
),
['container']
);
$document
->setTitle('Title')
->addStyle('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css')
->setBody($container)
->addScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js')
->addScript('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');
echo $document->getDocument();
} catch (InvalidDocumentException $e) {
die($e->getMessage());
} catch (ReflectionException $e) {
die($e->getMessage());
}
|