[eluser]sophistry[/eluser]
just turn on short tags and tell the client you found a good template parser. i wrote the documentation for you below. :-)
the syntax is very simple (and supports what you want - if and foreach)):
<? to start template tag,
?> to end template tag,
to display template variable use echo keyword,
example: <? echo $variable ?>
<? if($variable_to_test): ?> to start conditional,
<? endif; ?> to end conditional,
example: <? if($is_true): ?>
<? foreach($list as $item): ?> to start loop,
<? echo $item ?> inside loop
<? endforeach; ?> to end loop
in the controller...(developer will edit this)
Code:
function template()
{
$d['title']='this is a title';
$d['heading1']='this is a heading one';
$d['variable']='this is a variable.';
$d['rand_variable']='this is a variable to show at random.';
$d['show'] = rand(0,1);
$d['list'] = array('list item 1', 'list item 2', 'list item 3');
$this->load->view('tester',$d);
}
in the view (user will edit this)
Code:
<html>
<head>
<title><? echo $title ?></title>
</head>
<body>
<h1><? echo $heading1 ?></h1>
<? echo $variable ?><br />
<? if($show): ?>
<? echo $rand_variable ?>
<? else: ?>
This will print if the random variable is not shown on this page load - refresh page.
<? endif; ?>
<br />
<ol>
<? foreach($list as $item): ?>
<li><? echo $item ?></li>
<? endforeach; ?>
</ol>
</body>
</html>