What are some popular PHP template systems and their advantages and disadvantages?
Issue: When working with PHP, using a template system can help separate the presentation layer from the business logic, making the code more maintainable and easier to work with. Code snippet:
// Example of using the popular Smarty template system
require_once('libs/Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
$smarty->assign('name', 'John Doe');
$smarty->display('index.tpl');