Permalink
Browse files

Injection of function in order to be able to use helpers etc.

  • Loading branch information...
1 parent 6f0d4aa commit 2a4fa27710ef7878b9ce8ffc0e71b33aac5ea898 @tomaszozga tomaszozga committed Feb 29, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 application/libraries/Twig.php
@@ -33,6 +33,12 @@ function __construct($debug = false)
'cache' => $this->_cache_dir,
'debug' => $debug,
));
+
+ foreach(get_defined_functions() as $functions) {
+ foreach($functions as $function) {
+ $this->_twig->addFunction($function, new Twig_Function_Function($function));
+ }
+ }
}
public function add_function($name)

0 comments on commit 2a4fa27

Please sign in to comment.