Hi,
I've decided I want to start using a template system for all my scripts, so I've been looking at Smarty.
Am I right in saying that my layout (e.g. divs, tables, etc.) will be in the tpl file, and all the rest (error reporting etc.) in the PHP file?
The main bit I'm stuck on is showing a different layout according to a database query e.g.
Would I use the built in Smarty if and else to do that? Or is there something I'm missing?
Thanks,
Craig.
I've decided I want to start using a template system for all my scripts, so I've been looking at Smarty.
Am I right in saying that my layout (e.g. divs, tables, etc.) will be in the tpl file, and all the rest (error reporting etc.) in the PHP file?
The main bit I'm stuck on is showing a different layout according to a database query e.g.
Code:
if($user = isadmin)
{
<table>
This is a table for the administrator
</table>
}
else
{
<table>
This is a table for a normal user
</table>
}
Would I use the built in Smarty if and else to do that? Or is there something I'm missing?
Thanks,
Craig.