smartyTemplate问题 {literal} <style> p {font-size:12px} </style>{/literal} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 'left_delimiter' => '{{', 'right_delimiter' => '}}', Go_Rush :我用了你说的方法不行啊这是我的文件模板:<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>{title}</title>{literal}<style type="text/css">body{background:#369;}hr{width:auto;border:2px;border-color:#FFF;}h6{font-size:18px;color:#478962}</style>{/literal}</head><body><h6>{content}</h6><hr></body></html>PHP: include("./smarttemplate/class.smarttemplate.php"); $smarty=new SmartTemplate(); $smarty->template_dir="./template"; $smarty->temp_dir="./temp"; $smarty->cache_dir="./cache"; $smarty->cache_lifetime=1; $smarty->tpl_file="test1.html"; $smarty->assign("title","This is SmartyTemplate"); $smarty->assign("content>","This is a very template for PHP!!!!"); //$smarty->assign("css",$_REQUEST); $smarty->output(); 将样式写成body{***}这样子就不要紧啦 如何不输出表单 执行post操作 php输出pdf问题 PHP cookie问题 PHP 配置小问题,急在线等。解决给分~谢过各位大侠了! 要用PHP怎么实现 一个搜索引擎? 菜鸟问题!在线等!急!!!!!!!!!!!!!!!!100分相送,表感谢好心人! 问一个php调用数据库的问题! help!!! 我刚在WIN2000的缺省目录下安装了MYSQL,但服务中启动不了它,为什么? 关于php数据库操作类 在windows下如何安装和配置php开发环境呢? 简单功能【求助代码】
'right_delimiter' => '}}',
这是我的文件
模板:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{title}</title>
{literal}
<style type="text/css">
body{background:#369;}
hr{width:auto;border:2px;border-color:#FFF;}
h6{font-size:18px;color:#478962}
</style>
{/literal}
</head>
<body>
<h6>
{content}
</h6>
<hr>
</body>
</html>
PHP:
include("./smarttemplate/class.smarttemplate.php");
$smarty=new SmartTemplate();
$smarty->template_dir="./template";
$smarty->temp_dir="./temp";
$smarty->cache_dir="./cache";
$smarty->cache_lifetime=1;
$smarty->tpl_file="test1.html";
$smarty->assign("title","This is SmartyTemplate");
$smarty->assign("content>","This is a very template for PHP!!!!");
//$smarty->assign("css",$_REQUEST);
$smarty->output();
***}这样子就不要紧啦