Public Member Functions | |
template (&$tpl, $path, &$context) | |
macro (&$macro, $file, $name, &$context) |
Implement this interface and use PHPTAL_Template::setCacheManager() method to intercept macro and template execution with your own cache system.
The aim of this system is to fine grain the caching of PHPTAL results allowing the php coder to use whatever cache system he prefers with a good granularity as he can cache result of specific templates execution, and specific macros calls.
Definition at line 37 of file Cache.php.
|
Called each time a macro needs to be executed. This method allow cache on macro result. It must return the cache value or at least the macro execution result. function macro(&$macro, $file, $name, &$context) { // return cache if exists // else really process macro $res = $macro->_process(); // cache the result if needed // and return it return $res }
Definition at line 91 of file Cache.php. References macro(). Referenced by macro(). |
|
Called each time a template has to be executed. This method must return the cache value or the template execution return. function template(&$tpl, $path, &$context) { // return cache if exists // else realy process template $res = $tpl->_process(); // cache the result if needed // and return it return $res; }
|