We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 907ebb5 commit 60e8fa0Copy full SHA for 60e8fa0
libraries/Twig.php
@@ -16,9 +16,7 @@
16
17
class Twig
18
{
19
- private $config = [
20
- 'paths' => [VIEWPATH],
21
- ];
+ private $config = [];
22
23
private $functions_asis = [
24
'base_url', 'site_url'
@@ -44,6 +42,12 @@ class Twig
44
42
45
43
public function __construct($params = [])
46
+ // default config
+ $this->config = [
47
+ 'paths' => [VIEWPATH],
48
+ 'cache' => APPPATH . '/cache/twig',
49
+ ];
50
+
51
$this->config = array_merge($this->config, $params);
52
}
53
@@ -76,7 +80,7 @@ public function createTwig()
76
80
77
81
78
82
$twig = new \Twig_Environment($this->loader, [
79
- 'cache' => APPPATH . '/cache/twig',
83
+ 'cache' => $this->config['cache'],
84
'debug' => $debug,
85
'autoescape' => TRUE,
86
]);
0 commit comments