Re: Block functions
| From: | Anders Janson | Date: | Tue, 26 Mar 2002 14:59:24 +0000 |
| Subject: | Re: Block functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3351@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
> On Tue, 26 Mar 2002, Anders Janson wrote:
> > There were discussions about a tag stack, and an arguments stack for this
> > kind of block functions.
> > I think that would be the best solution to handle all sorts of situations.
> > For example where arguments are needed in the opening tag, but used in the
> > closing tag.
> > Or when an inner tag needs to know parameters from an outer tag (context
> > aware tags!).
> >
> > While it would be possible to implement this yourself in all custom tags you
> > write, it would be much more convenient if Smarty already had this
> > functionality. That would also make all tags compatible.
>
> Watch out, pretty soon Smarty is going to be brewing your coffee too.
Yes, please! And would it be possible to have Smarty take my dog out for a walk
while I drink the coffee? ;)
>
>
> Can you give a realistic example where attribute stack would be useful?
Yes.
Example 1:
{myform name="blabla"}
{my_checkbox name="foo"}
{/myform}
The Javascript for the input (checkbox) needs to know the name of the form it is
located in.
Example 2:
Whenever a closing tag needs to get the parameters entered in the opening tag.
/Anders