-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathtestcustom2.php
52 lines (39 loc) · 1.13 KB
/
testcustom2.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
<?php
namespace {
/**
* Copyright (c) 2016 Jorge Patricio Castro Castillo MIT License.
*/
include "../lib/BladeOne.php";
include "../lib/BladeOneHtml.php";
include "../lib/BladeOneCustom.php";
use eftec\bladeone\BladeOne;
use eftec\bladeone\BladeOneCustom;
use eftec\bladeone\BladeOneHtml;
$views = __DIR__ . '/views';
$compiledFolder = __DIR__ . '/compiled';
class myBlade extends BladeOne
{
protected function compileMyFunction($expression = '')
{
return $this->phpTag . "echo 'YAY MY FUNCTION IS WORKING " . $expression . "'; ?>";
}
}
$blade = new myBlade($views, $compiledFolder);
$blade->addAliasClasses('SomeClass', '\mynamespace\SomeClass');
$blade->setMode(BladeOne::MODE_DEBUG);
//</editor-fold>
try {
echo $blade->run("TestCustom.test2", []);
} catch (Exception $e) {
echo "error found " . $e->getMessage() . "<br>" . $e->getTraceAsString();
}
}
namespace mynamespace {
class SomeClass
{
public static function method($arg='empty')
{
return "<b>Method SomeClass::method($arg) called</b>";
}
}
}