This class is best used once you have created your template and are happy with it.
The class will basically save the compiled template code to a file for subsequent accesses.
This saves a lot of time skipping the entire compile phase.
If you then need to make a change to the template, you must clear the cache.
Example
|
To use vlibTemplateCache, you just need to alter your class instantiaton to:
$tmpl = vlibTemplateCache('mytemplates/mytemplatefile.html', $options);
|
vlibTemplateCache will recache itself if either the compiled file has been deleted,
the compiled file has passed the expiry
date set by the OPTION 'CACHE_LIFETIME' or if you use clearCache() or recache() to do it manually.
Please see the OPTIONS section for further details of how you can configure your own cache system.
Note
|
vlibTemplateCache caches a template once all of the <tmpl_include>'s have been parsed.
Therefore if you change one of the included files, you must recache for the changes to be taken into account.
|