简体   繁体   English

为什么在此代码中看到花括号?

[英]Why am I seeing curly braces in this code?

I'm looking at someone else's HTML, and I see that all strings are output within curly braces. 我正在查看其他人的HTML,并且看到所有字符串都在花括号内输出。

Here's an example from the HTML document: 这是HTML文档中的示例:

<td><div style="padding-top:10px; padding-bottom:10px" align="center">{_no_feedback_activity_found}</div></td>

What would be the purpose/advantage for doing things this way? 用这种方式做事的目的/优势是什么? Also, when the HTML is parsed, how does it access the actual string? 另外,在解析HTML时,它如何访问实际的字符串?

Please help me understand this concept... What exactly is going on with this document? 请帮助我理解这个概念...本文档到底在做什么?

The controller or whichever framework you are using, has a variable by the name _no_feedback_activity_found sent to this template. 控制器或您使用的任何框架都具有发送到此模板的名称为_no_feedback_activity_found的变量。 This is useful, when you have a designer work on the templating and a developer working on the framework, so the designer doesn't need to worry about the code. 当您有一名设计人员在模板上工作,而有一名开发人员在框架上工作时,这很有用,因此设计人员无需担心代码。

It appears that they are using a templating system (like smarty, twig, etc.), and somehow it isn't working. 看来他们正在使用模板系统(例如smarty,twig等),但某种程度上它不起作用。 There isn't any other known concept or reason for doing this except for substituting variable names in a templating system. 除了在模板系统中替换变量名称外,没有其他已知的概念或理由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM