Php Smarty模板引擎获取部分内容

Php Smarty模板引擎获取部分内容,php,smarty,Php,Smarty,如何在使用smarty时仅获取html输出并保存它 对于ex smarty fetch,以下功能适用 Dear {$contact_info.name}, Welcome and thank you for signing up as a member of our user group. Click on the link below to login with your user name of '{$contact_info.username}' so you can post in

如何在使用smarty时仅获取html输出并保存它

对于ex smarty fetch,以下功能适用

Dear {$contact_info.name},

Welcome and thank you for signing up as a member of our user group.

Click on the link below to login with your user name
of '{$contact_info.username}' so you can post in our forums.

{$login_url}

List master

{include file="footer.tpl"}
但是,如果我希望只获取其包含文件部分的包含部分,则该部分工作不正常

您可以使用将输出获取到变量中:

$output = $smarty->fetch('email.tpl');

我不确定您在问什么-是否要将输出捕获到变量中?或者只使用模板的一部分?是的,我希望捕获输出,但不捕获整个smarty输出,只捕获包含的文件内容