The Template class contains all functions relating to Ditto’s handling of templates and any supporting functions they need
| Template Class | The Template class contains all functions relating to Ditto’s handling of templates and any supporting functions they need |
| Functions | |
| template | Set the class language and fields variables |
| process | Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields |
| findTemplateVars | Find al the template variables in the template |
| sortFields | Sort the array of fields provided by type |
| replace | Replcae placeholders with their values |
| determine | Determine the correct template to apply |
| fetch | Get a template, based on version by Doze |
| get_file_contents | Returns the contents of file name passed |
function process( $template )
Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields
function fetch( $tpl )
Get a template, based on version by Doze
http://modxcms.com- /forums- /index.php- /topic- ,5344.msg41096.html#msg41096
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
Set the class language and fields variables
function template()
Take the templates and parse them for tempalte variables, Check to make sure they have fields, and sort the fields
function process( $template )
Find al the template variables in the template
function findTemplateVars( $tpl )
Sort the array of fields provided by type
function sortFields ( $fieldList )
Replcae placeholders with their values
function replace( $placeholders, $tpl )
Determine the correct template to apply
function determine( $templates, $x, $start, $stop, $id )
Get a template, based on version by Doze
function fetch( $tpl )
Returns the contents of file name passed
function get_file_contents( $filename )