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{***}这样子就不要紧啦 关于rewrite网址转向,可不可以指定一个不转,其它的都转? 哪裡有好用的合租 PHP 空間? 下拉框排序问题 MySQL中查询正常,PHP中却报错 告那些对学习PHP还不坚定的朋友 就没人知道么???!!!急死了! PHP中如何使用缓存加速? 菜鸟提问 自定义函数在while里只处理第一条是怎么个情况 常见的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();
***}这样子就不要紧啦