Skip to content

Commit f90f178

Browse files
committed
updated base UI
1 parent 10de491 commit f90f178

File tree

2 files changed

+1116
-0
lines changed

2 files changed

+1116
-0
lines changed

example.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
require "./src/UI.php";
3+
require "./src/UI/Template.php";
4+
5+
$ui = new \Leaf\UI\Template;
6+
7+
$arr = [
8+
["name" => "Michael"],
9+
["name" => "Seth"],
10+
["name" => "Mychi"],
11+
["name" => "Darko"],
12+
["name" => "Duodu"]
13+
];
14+
15+
$c = 3;
16+
17+
$ui::render((
18+
$ui::_template("Title Here", [
19+
$ui::_row([
20+
$ui::loop($arr, function($value, $key) use($ui, $c) {
21+
return (
22+
$ui::div([], [
23+
$ui::h2($ui::small("Name: ").$value["name"]),
24+
$ui::p("Something Really Interesting"),
25+
$ui::if($c == 2, (
26+
$ui::div([], "This is an if statement")
27+
), $ui::unless($c == 3, (
28+
$ui::div([], "This is an else if block")
29+
), (
30+
$ui::div([], "This is the else block")
31+
))),
32+
$ui::button("Click Me!!")
33+
])
34+
);
35+
}),
36+
]),
37+
$ui::_row([
38+
$ui::input("text", "browsers", ["list" => "browsers"]),
39+
$ui::datalist("browsers", ["Firefox", "Chrome", "Safari"]),
40+
$ui::_datalist("text", "browsers2", "browsers2", ["Firefox", "Chrome", "Opera", "Safari"])
41+
]),
42+
$ui::textarea("article"),
43+
$ui::select([
44+
"BTC" => "Bitcoin",
45+
"ETH" => "Ethereum"
46+
]),
47+
$ui::abbr("Hyper TextMarkup Language", "HTML")
48+
])
49+
));

0 commit comments

Comments
 (0)