此 html 代码是否在其中使用 php 而没有 迹象?
<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}">></a>
</span>
{/if}
我以前写过简单的基于 php 的网站,但这是我第一次涉足复杂的 php 网站,而其他人已经在很大程度上完成了。这也是我第一次在网站的 html 模板部分看到这种类型的代码。
基本上,我很好奇的是,{} 大括号中的所有代码是什么?它是某种 php 代码吗?另一个 php 文件引用了包含上述代码的 .html 文件。
有很多内容是动态生成的,但我从未见过在 .html 文件中使用“{}”大括号,同时将其用作模板的一部分,所以我想知道你们中的一些人是否可以启发我。
谢谢。
<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}">></a>
</span>
{/if}
I have written simple php based websites before but this is the first time I am getting involved in a complex php website that another person has already finished to a large extent. This is also the first time I'm seeing this type of code in a html template section of the website.
Basically, what I'm curious is, what are all the code in the {} curly brackets? Is it some sort of php code? Another php file refers this .html file that is containing the above code.
There is a lot of content being dynamically generated, but I've never seen '{}' curly brackets being used in a .html file while having it being used as part of a template so I was wondering if some of you guys could enlighten me.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一种 PHP 模板语言,具体来说是 Smarty。
Smarty 解析文件以获取其自己的语法,并用绑定到 smarty 视图的变量等替换其占位符。
Smarty 文档。
That is a PHP templating language, specifically, Smarty.
Smarty parses the file for its own syntax and replaces their placeholders with variables, etc that are bound to the smarty view.
Smarty Documentation.
这很聪明:
http://www.smarty.net/
That's smarty:
http://www.smarty.net/
您正在查看 Smarty 标签。以下是当前文档的链接。
You're looking at Smarty tags. Here's a link to the current documentation.
它很聪明:)
实际上你正在看部分。
http://www.smarty.net/docsv2/en/language.function .section.tpl
It's smarty :)
Actually you're looking at sections.
http://www.smarty.net/docsv2/en/language.function.section.tpl