Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

PHPTAL_Cache Class Reference

List of all members.

Public Member Functions

 template (&$tpl, $path, &$context)
 macro (&$macro, $file, $name, &$context)

Detailed Description

Interface to PHPTAL cache system.

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.

See also:
Documentation.txt
Author:
Laurent Bedubourg <laurent.bedubourg@free.fr>

Definition at line 37 of file Cache.php.


Member Function Documentation

PHPTAL_Cache::macro &$  macro,
file,
name,
&$  context
 

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 }

Parameters:
PHPTAL_Macro -- the macro to executed
string $file -- the macro source file
string $name -- the macro name
PHPTAL_Context $context -- the current execution context
Returns:
string

Definition at line 91 of file Cache.php.

References macro().

Referenced by macro().

PHPTAL_Cache::template &$  tpl,
path,
&$  context
 

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; }

Parameters:
PHPTAL_Template -- the template that must be cached/executed
string $path -- the template path
PHPTAL_Context $ctx -- the execution context
Returns:
string

Definition at line 61 of file Cache.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 29 23:40:58 2004 for Mediawiki by doxygen 1.3.7