Template Class

Purpose

The Template class contains all functions relating to Ditto’s handling of templates and any supporting functions they need

Summary
Template ClassThe Template class contains all functions relating to Ditto’s handling of templates and any supporting functions they need
Functions
templateSet the class language and fields variables
processTake the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields
findTemplateVarsFind al the template variables in the template
sortFieldsSort the array of fields provided by type
replaceReplcae placeholders with their values
determineDetermine the correct template to apply
fetchGet a template, based on version by Doze
get_file_contentsReturns the contents of file name passed

Functions

template

function template()

Set the class language and fields variables

process

function process($template)

Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields

findTemplateVars

function findTemplateVars($tpl)

Find al the template variables in the template

sortFields

function sortFields ($fieldList)

Sort the array of fields provided by type

replace

function replace($placeholders,
$tpl)

Replcae placeholders with their values

determine

function determine($templates,
$x,
$start,
$stop,
$id)

Determine the correct template to apply

fetch

function fetch($tpl)

Get a template, based on version by Doze

http://modxcms.com- /forums- /index.php- /topic- ,5344.msg41096.html#msg41096

get_file_contents

function get_file_contents($filename)

Returns the contents of file name passed

From http://www.nutt.net- /2006- /07- /08- /file_get_contents-function-for-php-4- /#more-210

function template()
Set the class language and fields variables
function process($template)
Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields
function findTemplateVars($tpl)
Find al the template variables in the template
function sortFields ($fieldList)
Sort the array of fields provided by type
function replace($placeholders,
$tpl)
Replcae placeholders with their values
function determine($templates,
$x,
$start,
$stop,
$id)
Determine the correct template to apply
function fetch($tpl)
Get a template, based on version by Doze
function get_file_contents($filename)
Returns the contents of file name passed