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('libs/Smarty.class.php');
function getCallerFilePath() {
error_reporting(E_ALL);
$stack = debug_backtrace();
$caller = $stack[0];
$path = explode('/', $caller['file']);
echo $path[0];
}
class smarty_connect extends Smarty
{
function smarty_connect()
{
$fixpath = dirname(__FILE__);
$fixpath = str_replace("\\","/",$fixpath);
$this->Smarty();
$this->template_dir = $fixpath."/templates";
$this->config_dir = $fixpath."/configs";
$this->compile_dir = $fixpath."/compiles";
$this->cache_dir = $fixpath."/cache";
$this->clear_compiled_tpl();
}
function displayTemplate($template) {
error_reporting(E_ALL);
getCallerFilePath();
//do something
}
}
?>
|