PHP Classes

File: example.tpl

Recommend this page to a friend!
  Classes of Martin Barker   Funcational Template Manager   example.tpl   Download  
File: example.tpl
Role: Auxiliary data
Content type: text/plain
Description: This would be in file location "template/default/"
Class: Funcational Template Manager
Template engine that replaces variables in files
Author: By
Last change: Edited to show the new function support inside a TPL
Date: 14 years ago
Size: 796 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Template file</title> </head> <body> {include file} -- this will include file.tpl from the template path<br /> {%test%} -- will output test for from the passedVars <br /> For Loop <br /> {for i = 1; i < 2; i++, <div>Hello %names.[i]%</div> } -- [i] count will output the counters number dose not need to be i can be anythign as long as matches the for or will not be replaced Foreach -- the following can use nested arrays E.G {foreach names.last}<br /> {foreach names, hello %[i]%<br /> } -- foreach of array </body> </html>