Hello,
In Codeigniter 3.0.6, Twig 1.24.0 project if in twig code I would like to clear all cache on any page reload.
In some cases it seems to me, that after I modify some twig and reload page by CTRL+R, the new changes were not applied to this page.
After I manually delete twig files it works ok.
twig is included to project as library
https://github.com/kenjis/codeigniter-ss-twig:
PHP Code:
$twig_config = array();
$this->load->library('twig', $twig_config);
$twig_Environment = $this->twig->getTwig();
$this->config is filled with :
PHP Code:
$this->config::Array
(
[paths] => Array
(
[0] => /mnt/diskD_Work/wwwroot/tb/application/views/
)
[cache] => /mnt/diskD_Work/wwwroot/tb/application/cache/twig
)
In $twig_Environment object output:
PHP Code:
$twig_Environment::Twig_Environment Object
(
[charset:protected] => UTF-8
[loader:protected] => Twig_Loader_Filesystem Object
(
[paths:protected] => Array
(
[__main__] => Array
(
[0] => /mnt/diskD_Work/wwwroot/tb/application/views
)
)
[cache:protected] => Array
(
)
[errorCache:protected] => Array
(
)
)
[debug:protected] =>
[autoReload:protected] =>
[cache:protected] => Twig_Cache_Filesystem Object
(
[directory:Twig_Cache_Filesystem:private] => /mnt/diskD_Work/wwwroot/tb/application/cache/twig/
[options:Twig_Cache_Filesystem:private] => 0
)
In codeigniter-ss-twig object I see :
PHP Code:
$debug= true; // for development envierement of CI project.
$twig = new \Twig_Environment($this->loader, [
'cache' => $this->config['cache'],
'debug' => $debug,
'strict_variables' => $debug,
'autoescape' => TRUE,
]);
If there are some more options/tuning to update cache any time I reload my page?
Thanks !