File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,20 @@ public function __construct($params = [])
3535 $ this ->config = array_merge ($ this ->config , $ params );
3636 }
3737
38+ public function resetTwig ()
39+ {
40+ $ this ->twig = null ;
41+ $ this ->createTwig ();
42+ }
43+
3844 public function createTwig ()
3945 {
46+ // $this->twig is singleton
47+ if ($ this ->twig !== null )
48+ {
49+ return ;
50+ }
51+
4052 if (ENVIRONMENT === 'production ' )
4153 {
4254 $ debug = FALSE ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public function setUp()
1919 'site_url ' => '{{ site_url( \'"><s>abc</s><a name="test \') }} ' ,
2020 ]);
2121 $ CI ->twig ->setLoader ($ loader );
22- $ CI ->twig ->createTwig ();
22+ $ CI ->twig ->resetTwig ();
2323
2424 $ this ->obj = $ CI ->twig ;
2525 $ this ->twig = $ CI ->twig ->getTwig ();
You can’t perform that action at this time.
0 commit comments