如何在php/smarty中包含静态html [英] How to include static html in php/smarty
问题描述
已要求我在此php/smarty页面中包含一些html代码段.付款前,这基本上是概述页面末尾的销售协议.
I have been asked to include some html snippet in this php/smarty page. It's basically a sales agreement at the end of an overview page before you pay.
将静态html包含到我的php/smarty模板中的代码是什么?
What is the code to include static html into my php/smarty template?
谢谢...
推荐答案
您的意思是包括一个包含静态HTML的文件吗?
Do you mean include a file containing static HTML?
<罢工>
{include file="htmlfile.html"}
{include file="htmlfile.html"}
修改
由于文件只是HTML,因此最好使用 {fetch}
,例如
As the file is just HTML, it might be better to use {fetch}
, e.g.
{fetch file="path/to/html/file.html"}
对于本地文件,可以使用完整系统 必须提供文件路径或路径 相对于已执行的php脚本.
For local files, either a full system file path must be given, or a path relative to the executed php script.
这篇关于如何在php/smarty中包含静态html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!