]> git.mxchange.org Git - friendica.git/blob - include/friendica_smarty.php
Implement Smarty3
[friendica.git] / include / friendica_smarty.php
1 <?php
2
3 require_once("library/Smarty/libs/Smarty.class.php");
4
5 class FriendicaSmarty extends Smarty {
6
7         public $filename;
8         public $root;
9
10         function __construct() {
11                 parent::__construct();
12
13                 $a = get_app();
14
15                 //$this->root = $_SERVER['DOCUMENT_ROOT'] . '/';
16                 $this->root = '';
17
18                 $this->setTemplateDir($this->root . 'view/smarty3/');
19                 $this->setCompileDir($this->root . 'view/smarty3/compiled/');
20                 $this->setConfigDir($this->root . 'view/smarty3/config/');
21                 $this->setCacheDir($this->root . 'view/smarty3/cache/');
22
23                 $this->left_delimiter = $a->smarty3_ldelim;
24                 $this->right_delimiter = $a->smarty3_rdelim;
25         }
26
27         function parsed($template = '') {
28                 if($template) {
29                         return $this->fetch('string:' . $template);
30                 }
31                 return $this->fetch('file:' . $this->root . $this->filename);
32         }
33 }
34
35
36