如何在 php/smarty 中包含静态 html

Kyl*_*yle 4 html php smarty include

我被要求在这个 php/smarty 页面中包含一些 html 片段。它基本上是付款前概览页面末尾的销售协议。

将静态 html 包含到我的 php/smarty 模板中的代码是什么?

谢谢...

Tom*_*igh 6

你的意思是包含一个包含静态 HTML 的文件吗?

{include file="htmlfile.html"}

编辑

由于文件只是 HTML,因此最好使用{fetch},例如

{fetch file="path/to/html/file.html"}
Run Code Online (Sandbox Code Playgroud)

对于本地文件,要么必须给出完整的系统文件路径,要么是相对于执行的 php 脚本的路径。