Different Blocks
| From: | Reto Hugi | Date: | Mon, 11 Nov 2002 12:01:32 +0000 |
| Subject: | Different Blocks | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6390@lists.php.net to get a copy of this message | ||
Hi,
I read a lot about how to handle blocks with smarty in the archive of
this mailinglist, but none of those solutions seems to work for me - or
maybe i just got stuck to the wrong approach - that's why i'm asking
here. (BTW: Please excuse my english)
What it's all about:
- one template with content
- a content can have text, code, forms etc.
could look like that:
<content>
<text />
<code />
<text />
<text />
<form or something else />
<code />
</content>
Other template-engines use "blocks" to generate html and paste
everything together in the right sequence.
I thought about using Smartys "section" together with some if clauses
(i.e. go through the array, if there is text, do the text block, if
there is code, do the code block etc).
Or maybe I should start another instance of smarty and do a fetch() for
blocks - but that's probably not really the idea of OOP and Smarty...
I would be very glad if someone could help, or at least point me into
the right direction - think I got lost somewhere... :-/
Bye,
Reto