-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
74 lines (64 loc) · 1.72 KB
/
index.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
70
71
72
73
<?php
$start = microtime(true);
require __DIR__ . '/vendor/autoload.php';
use Eskrano\FormBuilder\Builder;
$form = (new Builder(
new Eskrano\FormBuilder\Presenters\BootstrapThree()
))->setAction('/index.php')
->setMethod('POST')->block('row', function (Builder $builder) {
$field_1 = $builder->presenter->multiCol([
'sm' => 6,
'md' => 6,
], function () use ($builder) {
return $builder->copy()->text()->textArea()->getHtml();
});
$field_2 = $builder->presenter->multiCol([
'sm' => 6,
'md' => 6,
], function () use ($builder) {
return $builder->copy()->text()->text()->getHtml();
});
return $field_1 . $field_2;
})->separator()->select([
],json_encode([
'select_1',
'select_2',
'select_3'
]))->checkbox('Checkbox',[
'value' => 111
])->multiCheckbox([
[
'label' => 'first',
'options' => [
'value' => 'first'
]
],
[
'label' => 'second',
'options' => [
'value' => 'second'
]
]
]); ?>
<html>
<head>
<title>Eskrano Form Builder Example</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
Some Form
</div>
<div class="panel-body">
<?php echo $form->render(); ?>
</div>
</div>
<div class = "center-block">
<?php echo (microtime(true) - $start);?>
</div>
</div>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>