-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.php
54 lines (48 loc) · 1.83 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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());
}