|
@@ -214,6 +214,7 @@ require_once '/path/to/vendor/autoload.php';
|
|
|
$loader = new Twig_Loader_Filesystem('/path/to/templates');
|
|
|
$twig = new Twig_Environment($loader, array(
|
|
|
'cache' => '/path/to/compilation_cache',
|
|
|
+ 'auto_reload' => true, //автоматически перекомпилировать шаблон в кэше
|
|
|
));
|
|
|
|
|
|
echo $twig->render('index.tpl', array('url' => 'http://google.com',
|
|
@@ -228,6 +229,7 @@ Twig_Autoloader::register();
|
|
|
$loader = new Twig_Loader_Filesystem('templates/');
|
|
|
$twig = new Twig_Environment($loader, array(
|
|
|
'cache' => '/tmp/',
|
|
|
+ 'auto_reload' => true, //автоматически перекомпилировать шаблон в кэше
|
|
|
));
|
|
|
|
|
|
echo $twig->render('index.tpl', array('url' => 'http://google.com',
|