new idea to smarty
| From: | Xuefer | Date: | Wed, 13 Nov 2002 11:22:11 +0000 |
| Subject: | new idea to smarty | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6413@lists.php.net to get a copy of this message | ||
hi,
smarty is design to split "layout-logic" from "code-logic"
but "layout" is still mixed with "logic"
i have an idea that, smarty combine "compiling" and "spliting"(idea from other
non-compile template engine)
a simple example:
layout:
{split name="tablestart"}
<table>
{/split}
{split name="mainloop"}
<tr>
<td>
{$item.abc}
</td>
<td>
{/split}
{split name="tableend"}
</table>
{split}
logic:
{getsplit name="tablestart"}
{session name="item" loop=$items}
{getsplit name="mainloop"}
{/session}
{getsplit name="tablesend"}
all {split}..{/split} is cut off and store in Smarty, and put when {getsplit}
this is an simple example, u may not learn what important it is
but when the layout logic is complex, it's unmanagable for html-designers