-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (27 loc) · 881 Bytes
/
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
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Zofe\Deficient\Deficient;
use Zofe\DataForm\DataForm;
Deficient::boot("./");
## burp, move it somewhere
route_any('store', array('as'=>'save', function() {
Zofe\Burp\BurpEvent::queue('dataform.save');
}));
route_any('^/{save?}$', array('as'=>'home', function () {
$form = DataForm::create(User::find(1));
$form->text('name','Name')->rule('required');
$form->textarea('lastname','Lastname');
$form->checkbox('enabled','Enabled');
$form->submit('Save');
$form->saved(function() use ($form)
{
$form->message("ok record saved");
$form->linkRoute("home","Back to the Form");
});
echo blade('dataform.tests.form', compact('form'));
}));
route_missing(function() {
echo blade('dataform.tests.error', array(), 404);
die;
});
route_dispatch();