I want to enable caching in Twig. I found how to do this during creating of a Twig Environment object
$twig = new Twig_Environment($loader, array(
'cache' => '/path/to/compilation_cache',
));
But i want to add caching after object is constructed. Now can i do this?
I have the class that inherits Twig
class MyTwig extends Twig_Environment {
public function someFunction() {
// enable cache there
}
}
I need to enable cache inside the function someFunction()