This is the simple php example which is used for smarty if template.
<?php require './libs/Smarty.class.php'; $smarty = new Smarty; $smarty->template_dir = 'templates'; $smarty->assign($var); $smarty->display('if.tpl'); ?>