【问题标题】:Is this html code using php inside it without the <?php ?> signs?这个 html 代码是否在其中使用 php 而没有 <?php ?> 标志?
【发布时间】:2011-11-26 11:26:21
【问题描述】:
<a href="?page={$smarty.section.page.index}&{$per_pages_vars}">{$smarty.section.page.index}</a>
{/if}
{/section}
{if $pagesArray.is_next_page eq 'Y'}
  <span class="resultsnext">
    <a href="?page={$pagesArray.next_page_is}{if $id}&id={$id}{/if}&{$per_pages_vars}">&gt;</a>      
  </span>
{/if} 

我以前写过简单的基于 php 的网站,但这是我第一次涉足另一个人已经在很大程度上完成的复杂 php 网站。这也是我第一次在网站的 html 模板部分看到这种类型的代码。

基本上,我很好奇的是,{} 大括号中的所有代码是什么?它是某种php代码吗?另一个 php 文件引用了包含上述代码的 .html 文件。

有很多内容是动态生成的,但我从未见过在 .html 文件中使用“{}”大括号并将其用作模板的一部分,所以我想知道你们中的一些人是否各位大佬可以指点一下。

谢谢。

【问题讨论】:

    标签: php html templates curly-brackets


    【解决方案1】:

    这是一种 PHP 模板语言,具体来说,Smarty

    Smarty 将文件解析为自己的语法,并将其占位符替换为绑定到 smarty 视图的变量等。

    Smarty Documentation.

    【讨论】:

      【解决方案2】:

      这很聪明:

      http://www.smarty.net/

      【讨论】:

        【解决方案3】:

        您正在查看 Smarty 标签。这是current documentation的链接。

        【讨论】:

          【解决方案4】:

          这很聪明:)

          实际上,您正在查看部分。

          http://www.smarty.net/docsv2/en/language.function.section.tpl

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2018-05-02
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2012-02-09
            • 2016-07-26
            • 2015-04-26
            • 1970-01-01
            相关资源
            最近更新 更多