-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathtestbootstrap.php
63 lines (53 loc) · 1.42 KB
/
testbootstrap.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
<?php
/**
* Copyright (c) 2016 Jorge Patricio Castro Castillo MIT License..s
*/
use eftec\bladeone\BladeOne;
use eftec\bladeone\BladeOneHtmlBootstrap;
include "../lib/BladeOne.php";
include "../lib/BladeOneHtml.php";
include "../lib/BladeOneHtmlBootstrap.php";
$views = __DIR__ . '/views';
$compiledFolder = __DIR__ . '/compiled';
class myBlade extends BladeOne
{
use BladeOneHtmlBootstrap;
}
$blade=new myBlade($views, $compiledFolder);
$blade->setMode(BladeOne::MODE_DEBUG);
//<editor-fold desc="Example data">
$countries=[];
$country=new stdClass();
$country->id=1;
$country->cod='ar';
$country->name="Argentina";
$country->continent="America";
$countries[]=$country;
$country=new stdClass();
$country->id=2;
$country->cod='ca';
$country->name="Canada";
$country->continent="America";
$countries[]=$country;
$country=new stdClass();
$country->id=3;
$country->cod='us';
$country->name="United States";
$country->continent="America";
$countries[]=$country;
$country=new stdClass();
$country->id=4;
$country->cod='jp';
$country->name="Japan";
$country->continent="Asia";
$countries[]=$country;
$countrySelected=3;
$multipleSelect=[1,2];
//</editor-fold>
try {
echo $blade->run("TestBS.hellobootstrap", ["countries" => $countries
, 'countrySelected' => $countrySelected
, 'multipleSelect' => $multipleSelect]);
} catch (Exception $e) {
echo "error found ".$e->getMessage()."<br>".$e->getTraceAsString();
}