Skip to content

Commit 114fbd9

Browse files
committed
added template config
1 parent bef7d23 commit 114fbd9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

installer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ copyFiles([
2020
"config/cache.php.sample"=>"config/cache.php",
2121
"config/session.php.sample"=>"config/session.php",
2222
"config/modules.php.sample"=>"config/modules.php",
23+
"config/template.php.sample"=>"config/template.php",
2324
]);
2425
echo "\nPhreak! has been successfuly installed!\n";
2526
echo "################ Enjoy! ################\n";

system/Config.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public function __construct ()
1212
'system'=>ROOT_DIR.'/config/system.php',
1313
'cache'=>ROOT_DIR.'/config/cache.php',
1414
'database'=>ROOT_DIR.'/config/database.php',
15-
'session'=>ROOT_DIR.'/config/session.php'
15+
'session'=>ROOT_DIR.'/config/session.php',
16+
'template'=>ROOT_DIR.'/config/template.php'
1617
];
1718
$this->conf = [
1819
'site_url'=>BASE_URL,

system/Template.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
namespace System;
12-
use DI\Container;
1312

1413
class Template extends \Smarty {
1514
private $req;
@@ -31,11 +30,11 @@ public function __construct (Config $conf, Language $language) {
3130
}
3231
$this->assign('baseurl',$baseurl);
3332

34-
$this->setTemplateDir(ROOT_DIR.'/app/views/')
35-
->setCompileDir($this->conf->cache['smarty']['compiledir'])
36-
->setCacheDir($this->conf->cache['smarty']['cachedir'])
37-
->setConfigDir(ROOT_DIR."/storage/languages")
38-
->addPluginsDir(ROOT_DIR."/plugins/smarty");
33+
$this->setTemplateDir($this->conf->template['template_dir'])
34+
->setCompileDir($this->conf->template['compile_dir'])
35+
->setCacheDir($this->conf->template['cache_dir'])
36+
->setConfigDir($this->conf->template['languages_dir'])
37+
->addPluginsDir($this->conf->template['plugins_dir']);
3938

4039
// register basic internal functions
4140
$this->registerPlugin('function', "show_msg", array($this, 'show_msg'));

0 commit comments

Comments
 (0)