-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
69 lines (61 loc) · 1.51 KB
/
example.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
require_once('src/class.PHML.php');
/**
* Settings
*/
$cfg = [
'title' => 'MyTitle', // page title - REQUIRED
'desc' => 'My simple page', // page description - OPTIONAL
'keywords' => 'key1,key2,key3', // page keywords - OPTIONAL
'author' => 'Paulo' // page author - OPTIONAL
];
/**
* Initialize
*/
$phml = new PHML($cfg['title'], $cfg['desc'], $cfg['keywords'], $cfg['author']);
/**
* Set my default theme
*/
$phml->theme('bootstrap3'); // available: bootstrap3, bootstrap4 or mdl
/**
* Construct params to be used later
*/
$getContent = $phml->list('pre', [1, 2, 3, 4]);
$getList = $phml->array('a',
[
'Github',
'Twitter'
],
[
'href' => [
'https://github.com',
'https://google.com'
]
]
);
/**
* Moving below - lazy method
*/
$phml->create('br');
/**
* Creating a div
*/
$div2 = null;
$div2 .= $phml->add('h1', 'My div is below:');
$div2 .= $phml->add('strong', 'See my div below...', ['style' => 'color:#999']);
$phml->create('div', $div2, ['align' => 'center']);
/**
* Creating another div
*/
$div1 = null;
$div1 .= $phml->add('h3', 'My numbers:');
$div1 .= $phml->add('div', $getContent, ['id' => 'myDiv']);
$div1 .= $phml->add('h3', 'My links:');
$div1 .= $phml->add('strong', 'Below you see links...', ['style' => 'color:#999']);
$div1 .= $phml->add('ul', $phml->list('li', $getList));
$phml->create('div', $div1, ['class' => 'container']);
/**
* Show the content
*/
$phml->show();
?>