Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
MTemplate Class Reference

Public Member Functions

 __construct ($namespace="mtemplate")
 transform ()
 useCache ($file=false, $validity=3600, $path=false)
 loadTemplate ($path)

Static Public Member Functions

static loadFile ($filename, $block_size=8192)

Data Fields

 $template = false
 $data = false
 $namespace = "mtemplate"

Protected Attributes

 $cache_path = false
 $cache_file = false
 $cache_validity = 3600

Constructor & Destructor Documentation

__construct ( namespace = "mtemplate")

Constructor

Returns:
MTemplate

Member Function Documentation

static loadFile ( filename,
block_size = 8192 
) [static]
   Reads an entire file and returns it's content
Parameters:
string$filenameFull path of the file
integer$block_sizeDefault size of the block for read operation
Returns:
string
loadTemplate ( path)

Load the template from a file

Parameters:
string$path
transform ( )

Transform the loaded template, using the current array of data

Returns:
string The resulting document
useCache ( file = false,
validity = 3600,
path = false 
)

Enable or disable the cache system

Parameters:
string$fileIf FALSE, disable the cache system. Otherwise this must be the filename of the cachefile
integer$validityValidity of the cache in seconds
string$pathPath where to store the cache files (If FALSE, the current folder will be used)

Field Documentation

$cache_file = false [protected]
$cache_path = false [protected]
$cache_validity = 3600 [protected]
$data = false
$namespace = "mtemplate"
$template = false

The documentation for this class was generated from the following file: