\myMVC_BaseEngine

Base class for a template engine.

This does nothing and must be derived. See myMVC_SmartyEngine for a template engine using Smarty (http://www.smarty.net/)

Summary

Methods
Properties
Constants
__construct()
getTemplateDirectory()
assignVariable()
assignObject()
registerFunction()
registerModifier()
display()
fetch()
No public properties found
No constants found
No protected methods found
$templateDirectory
$compileDirectory
N/A
No private methods found
No private properties found
N/A

Properties

$templateDirectory

$templateDirectory : 

Type

$compileDirectory

$compileDirectory : 

Type

Methods

__construct()

__construct(string  $templateDirectory, string  $compileDirectory) 

Constructor

Parameters

string $templateDirectory

Directory with the templates

string $compileDirectory

Directory with the compiled templates (from engine)

Throws

\myMVC_MVCException

On problems

getTemplateDirectory()

getTemplateDirectory() : string

Returns the template directory

Returns

string —

The template directory

assignVariable()

assignVariable(string  $key, mixed  $value) 

Assign a key to the template

Parameters

string $key

The key

mixed $value

The value

assignObject()

assignObject(string  $key, mixed  $object) 

Assign an object to the template (reference)

Parameters

string $key

The key

mixed $object

The object

registerFunction()

registerFunction(string  $name, mixed  $func) 

Register a function to be called from template

Parameters

string $name

The name of the function (in template!!)

mixed $func

The name function or method (method in the format class::method)

                               Also accepted in the format array('class', 'method').

registerModifier()

registerModifier(string  $name, mixed  $func) 

Register a modifier to be called from template

Parameters

string $name

The name of the modifier (in template!!)

mixed $func

The name function or method (method in the format class::method)

                               Also accepted in the format array('class', 'method').

display()

display(\class  $view) 

Render a template an send it to the browser

Parameters

\class $view

The current view (to get the template)

fetch()

fetch(\class  $view) : string

Render a template an returns it as string

Parameters

\class $view

The current view (to get the template)

Returns

string —

The rendered template