What are the advantages and disadvantages of using Smarty as a template engine in PHP development?
When using Smarty as a template engine in PHP development, some advantages include separation of presentation and logic, easier maintenance and updates, and improved code readability. However, some disadvantages include the learning curve associated with using a new template engine, potential performance overhead, and the need to learn a new syntax.
// Example PHP code using Smarty template engine
require_once('smarty/libs/Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('name', 'John Doe');
$smarty->display('index.tpl');