如题,我在看下面的代码,其中有一些问题。在html/php中使用{{&var}}的模板语言是什么?
<p>
{{&agent_type}}
<input type="text" class="input-small" name="agent_name" value="{{agent_name}}" /> Mr/Ms
<input name="no_disturb" type="checkbox" value="1" {{#if no_disturb}}checked="checked"{{/if}}> Please dont disturb
</p>
在我的浏览器将其转换成这(从萤火虫复制)
<p>
<select name="agent_type" class="input-small">;
<option value="0" selected="selected">AA</option>
<option value="0" selected="selected">BB</option>
</select>
<input type="text" value="" name="agent_name" class="input-small"> Mr/Ms
<input type="checkbox" checked="checked" value="1" name="no_disturb"> Please dont disturb</p>
但
<select name="agent_type" class="input-small">;
<option value="0" selected="selected">AA</option>
<option value="0" selected="selected">BB</option>
</select>
只是表示作为一个字符串,而不是在浏览器中选择输入。
问题:
1.模板语言,这是?
2.如何修复显示字符串? (有点缺乏“EVAL” js函数等)
为什么不能在正在生成此PHP代码看?这将是最可靠的方式。 (模板语言,诸如Smarty可以配置为使用任意分隔符) – 2013-03-11 10:03:37
我不太肯定它是一个PHP语言。它可能是JavaScript模板语言的可能吗?是否有可能js有这些? – 2013-03-11 10:09:29
如果您在“查看源代码”视图中有HTML,请不要使用HTML。 JS无法生成。 – 2013-03-11 10:10:16