Login   Register  
PHP Classes
elePHPant
Icontem

File: index.tpl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rick Hopkins  >  plato  >  index.tpl  >  Download  
File: index.tpl
Role: Example script
Content type: text/plain
Description: index template file
Class: plato
Template parsing engine
Author: By
Last change: Includes code for assigning filenames to variables for the plato_include method.
index.php
-----------
$pl->assign("header", "header.tpl");

index.tpl
-----------
{plato_include=header&type=tpl&ref=1}

ref=1 relates the plato_include=header to the header variable created in index.php

Also include code for setting a dynamic value to the _stateSel function call.
index.php
-----------
$pl->assign("state", array("selected" => "MI", "class" => "input"));

index.tpl
-----------
{plato_func=_stateSel&var=state&ref=1}

ref=1 relates the var=state to the state variable you created in index.php
Date: 2004-02-19 08:58
Size: 1,246 bytes
 

Contents

Class file image Download
{plato_include=header&type=tpl&ref=1}
<br>
{test1}<br>
<br>
{test2}<br>
<br>
<br>
<table width="300" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td colspan="2" bgcolor="#EEEEEE"><h1><b>Working on a looping condition...</b></h1></td>
</tr>
<tr>
<td colspan="2">
<table width="100%" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#CCCCCC" align="center"><h1><b>Name:</b></h1></td>
<td bgcolor="#CCCCCC" align="center"><h1><b>Age:</b></h1></td>
<td bgcolor="#CCCCCC" align="center"><h1><b>Title:</b></h1></td>
</tr>
{plato_loop=name&id=outer}
<tr>
<td bgcolor="#EEEEEE" align="center"><h1 style="color:GREEN;">{name}</h1></td>
<td bgcolor="#EEEEEE" align="center"><h1>{age}</h1></td>
<td bgcolor="#EEEEEE" align="center"><h1>{position}</h1></td>
</tr>
{/outer}
</table>
</td>
</tr>
</table>
<br><br>
<b>All 3 function calls below are down with plato plugins...</b><br>
<b>Function Call</b> _test()<hr>
{plato_func=_test&var=argVal&ref=1}
<br>
<br>
<b>Function Call</b> _date()<hr>
{plato_func=_date&var[format]=F d, Y&var[date]=2004-03-27&var[message]=: My Birthday}
<br>
<br>
<b>Function Call</b> _stateSel()<hr>
{plato_func=_stateSel&var=state&ref=1}
{plato_include=footer.tpl&type=tpl}