What are the advantages and disadvantages of using a template engine like Smarty in PHP development?

Using a template engine like Smarty in PHP development can help separate the presentation layer from the business logic, making code more maintainable and easier to work with for designers and developers. However, using a template engine can introduce additional complexity and overhead to the project, potentially slowing down performance.

// Example of using Smarty template engine in PHP
require_once('smarty/Smarty.class.php');

$smarty = new Smarty;

$smarty->assign('name', 'John Doe');
$smarty->display('index.tpl');