GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Wednesday, April 6, 2011

Smarty - Basic Syntax

Your main file is php file: index.php
Then your template file is a file that has .tpl extension
In index file, you write:
<?php
require_once('../libs/Smarty.class.php');

$smarty = new Smarty();
$smarty->assign('title', 'Personal Web Service');

$smarty->display('index.tpl');

?>

Then your tempate file, looks like:
<h1>Title: {$title}</h1>

Share/Bookmark

No comments:

Post a Comment