Имеются следующие Smarty шаблоны
main.tpl<html><head><title>{#TITLE_#}</title></head><body><b>Name:</b>{$Name}<b>Last Name:</b> {$LastName}</body></html>
и
page.confTITLE_ = "Test page"
Написать программу, которая по этим шаблонам генерирует html-страницу с заголовком «Test page» и содержанием вида:
Name: Иван Last Name: Петров
(Отметьте один правильный вариант ответа.)
Варианты ответа
<?define("SMARTY_DIR","c://users/nina/Smarty/libs/");require(SMARTY_DIR."Smarty.class.php"); $smarty = new Smarty; $smarty->template_dir = "c:/smarty_dirs/book/templates/";$smarty->compile_dir = "c:/smarty_dirs/book/templates_c/";$smarty->config_dir = "c:/smarty_dirs/book/configs/";$smarty->cache_dir = "c:/smarty_dirs/book/cache/";$smarty->append(array(Name => "Иван",LastName => "Петров"));$smarty->display("main.tpl");?>
<?define("SMARTY_DIR","c://users/nina/Smarty/libs/");require(SMARTY_DIR."Smarty.class.php"); $smarty = new Smarty; $smarty->template_dir = "c:/smarty_dirs/book/templates/";$smarty->compile_dir = "c:/smarty_dirs/book/templates_c/";$smarty->config_dir = "c:/smarty_dirs/book/configs/";$smarty->cache_dir = "c:/smarty_dirs/book/cache/";$smarty->config_load("page.conf");$smarty->assign(array(Name => "Иван",LastName => "Петров", TITLE_ => "Test Page"));$smarty->parse("main.tpl");?>
<?define("SMARTY_DIR","c://users/nina/Smarty/libs/");require(SMARTY_DIR."Smarty.class.php"); $smarty = new Smarty; $smarty->template_dir = "c:/smarty_dirs/book/templates/";$smarty->compile_dir = "c:/smarty_dirs/book/templates_c/";$smarty->config_dir = "c:/smarty_dirs/book/configs/";$smarty->cache_dir = "c:/smarty_dirs/book/cache/";$smarty->config_load("page.conf");$smarty->assign(array(Name => "Иван",LastName => "Петров"));$smarty->display("main.tpl");?>(Верный ответ)
<?define("SMARTY_DIR","c://users/nina/Smarty/libs/");require(SMARTY_DIR."Smarty.class.php"); $smarty = new Smarty; $smarty->template_dir = "c:/smarty_dirs/book/templates/";$smarty->compile_dir = "c:/smarty_dirs/book/templates_c/";$smarty->config_dir = "c:/smarty_dirs/book/configs/";$smarty->cache_dir = "c:/smarty_dirs/book/cache/";$smarty->assign(array(Name => "Иван",LastName => "Петров"));$smarty->display("main.tpl");?>