
30.08.2008, 18:57
|
|
Участник форума
Регистрация: 06.06.2008
Сообщений: 162
Провел на форуме: 3942177
Репутация:
244
|
|
Можно и без smarty, если я так понял:
PHP код:
<?php
$shablon = '<html>
<head>
<title>test</title>
</head>
<body>
{MENU}
</body>
</html>';
$menu = "<a href=\"#\">Меню</a>";
$men = str_replace ("{MENU}", $menu , $shablon );
echo $men;
?>
На smarty:
PHP код:
<?php
require_once('./Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';
$smarty->cache_dir = './cache/';
$smarty->assign('menu', 'Меню');
$smarty->display('shablon.tpl');
?>
Последний раз редактировалось Jer1cho; 30.08.2008 в 19:28..
Причина: Теги не закрыл =))
|
|
|