Abstract engine interface for view layer, provides a means to make view method calls standardised regardless of rendering engine. If a method is not implemented in the template engine, then it should still be implemented but just return the engine instead e.g. for those template layers that do not have a config directory; simply return $this.

All engines should inherit from this class an must implement all methods whether the engine actually uses them or not. The extension class must be named:


Where TYPE is the short name for the engine e.g. Smarty has an engine class named mvcViewEngineSmarty, PHPTal could be mvcViewEnginePhptal etc.


public __construct()

Returns a new instance of the mvcViewEngineBase

public getEngine()

Returns the template engine instance

public abstract initialise()

Performs any engine specific initialisation of the engine

public abstract setCompileCheck($inStatus)

Enable or disable template compile checking

public abstract setCaching($inStatus)

Enable or disable caching

public abstract setCacheLifetime($inLifetime)

Set the cache lifetime in seconds

public abstract setTemplateDir($inTemplateDir)

Set the template directory

public abstract setConfigDir($inConfigDir)

Set the config directory for the template engine (if applicable)

public abstract setCompileDir($inCompileDir)

Set the compile directory where templates are compiled (if applicable)

public abstract setCacheDir($inCacheDir)

Set the cache directory where complete templates are cached (if applicable)

public abstract setUseSubDirs($inStatus)

Use sub folders in the cache directory (if applicable)

public abstract assign($inVarName, [$inVar = null])

Assign a value to the template

public abstract getTemplateVar($inVarName)

Returns an already assigned template var

public abstract isCached($inTemplate, [$inCacheID = null], [$inCompileID = null])

Returns true if the template is cached

public abstract clearCache()

Clears all cached and compiled template files for the current request

public abstract compile($inTemplate, [$inCacheID = null], [$inCompileID = null])

Compiles but does not display the template, returns compiled template as a string

public abstract render($inTemplate, [$inCacheID = null], [$inCompileID = null])

Compiles and displays the template to the browsing agent

<  1  >