【问题标题】:mpdf page numbering {PAGENO} with smarty template engine带有 smarty 模板引擎的 mpdf 页码 {PAGENO}
【发布时间】:2014-11-11 08:22:30
【问题描述】:

我想在mpdf 中使用pagenumberingmpdf 手册中描述的标签:

http://mpdf1.com/manual/index.php?tid=109

问题是我使用了 smarty 模板引擎,我不能在 html 模板中直接使用 header/footer 中的 mpdf 标签 {PAGENO},因为我认为 smarty 期望在 {} 括号变量中。 (例如{$test}

所以当我定义 {PAGENO} 时,smarty 得到语法错误:无法识别的标签 'PAGENO' ...

我也尝试调用此方法,但它不起作用->当我生成 pdf 时,生成的 pdf 中与页码无关:

// 设置一个包含页码的简单页脚

$mpdf->setFooter('{PAGENO}');

有人知道,我如何在 smarty 模板引擎中使用mpdf 页码?

谢谢

【问题讨论】:

  • @Sandesh:请不要使用代码跨度 (like this) 来突出显示您认为重要的术语。代码跨度仅适用于句子中的变量或部分代码。欲了解更多信息,请查看this post。谢谢!

标签: php smarty mpdf


【解决方案1】:

只需在您的 html 模板中使用 {literal}

{literal}{PAGENO}{/literal}

【讨论】:

    猜你喜欢
    • 2011-06-03
    • 1970-01-01
    • 2016-09-28
    • 2013-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多