0

下面代码中所有 {# ... #} 标签的含义是什么?

 {include file="header.tpl" title="install" showheader="no"}

<div class="install" style="text-align:center;padding:5% 0 0 0;">
    <div style="text-align:left;width:500px;margin:0 auto;padding:25px 25px 15px 25px;background:white;border:1px solid;">

        <h1>{#installcollabtive#}</h1>

        <div style="padding:16px 0 16px 0;">
            <h2>{#installstep#} 3</h2>
            <em>{#createadmin#}</em><br /><br />

            <form class = "main" name = "adminuser" method = "post" enctype="multipart/form-data" action = "install.php?action=step3">
                <fieldset>
                    <div class = "row"><label for = "username">{#name#}:</label><input type = "text" name = "name" id = "username" /></div>
                    <div class = "row"><label for = "pass">{#password#}:</label><input type = "password" name = "pass" id = "pass" /></div>
                </fieldset>
                <br />
                    <div class="row-butn-bottom">
                        <label>&nbsp;</label>
                        <button type="submit"  onfocus="this.blur();">{#continue#}</button>
                    </div>
                </fieldset>
            </form>

                </div>
            </div>
        </div> {*Install end*}
    </body>
</html>

任何帮助将不胜感激,非常感谢!

4

1 回答 1

1

从配置文件加载的变量通过将它们包含在 内#hash marks#或使用 smarty 变量来引用$smarty.config。后面的语法对于嵌入引用的属性值很有用。

示例配置文件:

pageTitle = "This is mine"
bodyBgColor = '#eeeeee'
tableBorderSize = 3
tableBgColor = "#bbbbbb"
rowBgColor = "#cccccc"

演示该#hash#方法的模板:

{config_load file='foo.conf'}
<html>
<title>{#pageTitle#}</title>
<body bgcolor="{#bodyBgColor#}">
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
<tr bgcolor="{#rowBgColor#}">
    <td>First</td>
    <td>Last</td>
    <td>Address</td>
</tr>
</table>
</body>
</html>

演示该$smarty.config方法的模板:

{config_load file='foo.conf'}
<html>
<title>{$smarty.config.pageTitle}</title>
<body bgcolor="{$smarty.config.bodyBgColor}">
<table border="{$smarty.config.tableBorderSize}" bgcolor="{$smarty.config.tableBgColor}">
<tr bgcolor="{$smarty.config.rowBgColor}">
    <td>First</td>
    <td>Last</td>
    <td>Address</td>
</tr>
</table>
</body>
</html>
于 2013-09-16T10:13:58.107 回答