$smarty->assign('name', 'John Doe'); Hello, {$name}!
$users = array( array('name' => 'John Doe', 'age' => 30), array('name' => 'Jane Smith', 'age' => 25), array('name' => 'Bob Johnson', 'age' => 40), ); $smarty->assign('users', $users);
{include file="header.tpl"} Welcome to my website! {include file="footer.tpl"}Smarty is often packaged with popular PHP frameworks such as Laravel and CodeIgniter. However, it can also be used as a standalone library in any PHP project.