HOW TO USE ND_Template class ND_Template is a template engine class. You can extends functionality with plugin, some examples are given in Librairies/ND/Template/Plugin directory. Normaly, this class is simple to use. I) instanciate the class $oTemplate = new ND_Template(); II) Assign a template a) with a string code: $oTemplate->setContent('this is my first use with {{a value to assign}} and {{secondValue}}'); b) or with a template file code: $oTemplate->setFromFile('./myTemplateFile.html'); III) Assign value a) assign values one by one code: $oTemplate->assign('a value to assign', 'my first assignement') ->assign('secondValue', 'a second example of assignement'); b) assign values with one method code: $oTemplate->multiAssign( array( 'a value to assign' => 'my first assignement' , 'secondValue' => 'another assignement' )); ND_Template could assign values of array and public properties of object. c) Assignement of array values To use it, you must have a pattern like {{array.key}} code: $aMan = array('firstname' => 'John', 'lastname' => 'Doe'); $oTemplate->setContent('Hello {{item.firstname}} {{item.lastname}}') ->assign('item', $aMan); d) assign with object properties To use object properties, you must have pattern like {{object..property}} BEWARE: if object have __toString method, the properties are not used IV) Using plugin plugin are function or class method, you can use to add some treatment to the content of the template instance. a) using it with a function code: $oTemplate->addPlugin('utf8encode', 'utf8_encode'); b) using it with a method For example, the class ND_Template_Plugin_CleanHtml replace blank and HTML comment by space. code: $oTemplate->addPlugin('clean' , array( new ND_Template_Plugin_CleanHtml , 'execute')); V) Display the content of ND_Template instance To display content, make a simple echo code: echo $oTemplate ; VI) Specific pattern a) file inclusion Use the pattern {{include:/path/to/the/template/file}} to add the content of /path/to/the/template/file b) repetition with pattern Use the pattern {{repeat:array of value,content or pathfile,item to remplace[, nb of iteration]}} code: $oTemplate->setContent('