我有一个模板文件a.tpl。我现在php文件里面写一个邮件发送的程序,在这个程序中我要先给a.tpl赋值。然后调用a.tpl这个文件。我的代码是
$smarty->assign('a',$a);
$smarty->display(a.tpl);
但是在调用的时候显示a.tpl的页面,我不行显示这个页面,请问我要怎么做,或者使用其它方法实现也可以。
$smarty->assign('a',$a);
$smarty->display(a.tpl);
但是在调用的时候显示a.tpl的页面,我不行显示这个页面,请问我要怎么做,或者使用其它方法实现也可以。
不过你这样显示个空白页面有什么意思?
赋值 与 获取$smarty->display('a.tpl') 之间还有一些什么特殊操作要求吗?如果中间还要需要操作的,你可以:
$smarty->assign('a',$a);
....
....
do something
$smarty->display(a.tpl);
==========================
即可,因为smarty 赋值后不一定需要立即显示出来的.
$html=file_get_contents(dirname(__FILE__).'/templates/email/mail.html');
send_mail('',$row['email'],$tuan_subject,$html,$is_html)
但是超时
换成$html='aaa'正常。
处理file_get_contents()函数要很长时间吗?
如果你只是想获取这个a.tpl赋值后的内容用$res = $smarty->fetch(a.tpl);不太清楚你想怎么调用这个a.tpl