-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
php.zep
61 lines (52 loc) · 1.78 KB
/
php.zep
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
/*
+------------------------------------------------------------------------+
| Phalcon Framework |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2017 Phalcon Team (https://phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@phalconphp.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@phalconphp.com> |
| Eduar Carvajal <eduar@phalconphp.com> |
+------------------------------------------------------------------------+
*/
namespace Phalcon\Mvc\View\Engine;
use Phalcon\Mvc\View\Engine;
/**
* Phalcon\Mvc\View\Engine\Php
*
* Adapter to use PHP itself as templating engine
*/
class Php extends Engine
{
/**
* Renders a view using the template engine
*/
public function render(string! path, var params, boolean mustClean = false)
{
var key, value;
if mustClean === true {
ob_clean();
}
/**
* Create the variables in local symbol table
*/
if typeof params == "array" {
for key, value in params {
let {key} = value;
}
}
/**
* Require the file
*/
require path;
if mustClean === true {
this->_view->setContent(ob_get_contents());
}
}
}