【发布时间】:2014-09-23 09:01:23
【问题描述】:
我基本上有这个代码:
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>{$root.page.contentgroup.Directory[0]}</td>
<td>{$root.page.contentgroup.Title[0]}</td>
<td>{$root.page.contentgroup.Description[0]}</td>
</tr>
</table>
我想添加一个按钮,当我单击它时,它会生成 3 个 txt 文件。 当脚本生成 txt 文件时,它应该根据 {$root.page.contentgroup.Directory[0]} 定位它们。 例如:
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>mydirectory</td> {**directory.txt**}
<td>mytitle</td> {**title.txt**}
<td>mydescription</td> {**description.txt**}
</tr>
</table>
[SUBMIT]
当我点击提交时,脚本会生成 3 个 txt 文件并将它们定位到
mysite/folder/{$root.page.contentgroup.Directory[0]}/directory.txt
mysite/folder/{$root.page.contentgroup.Directory[0]}/title.txt
mysite/folder/{$root.page.contentgroup.Directory[0]}/description.txt
什么是更好的方法?我只能使用聪明的功能(((
谢谢
【问题讨论】:
-
你应该用 PHP 而不是 Smarty 来做