How to include static html in php/smarty

前端 未结 4 470
独厮守ぢ
独厮守ぢ 2021-01-13 14:49

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.

What is the

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-13 15:32

    Before you display the template, in the PHP file try this:

    $smarty->assign('Sectionfile','section-name.html');
    $smarty->display('template.tpl');
    

    in the template itself:

    {include file="html_dir/$Sectionfile"} 
    

提交回复
热议问题