smarty模板

 
<?php
require('../libs/Smarty.class.php');
$smarty = new Smarty;
//$smarty->force_compile = true;
//$smarty->debugging = true;
//$smarty->caching = true;
//$smarty->cache_lifetime = 120;
$Name="Linux环境高级编程";
$smarty->assign("name",$Name);
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";

$smarty->display("index.html"); //编译并显示位于./templates下的index.htm模板
?>

index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
  </head>
  <body>
    名称:<{$name}>
  </body>
</html>

你可能感兴趣的:(html,编程,linux)