Feature Requests item #543468, was opened at 2002-04-13 14:21
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403614&aid=543468&group_id=31885
Category: None
Group: None
Status: Open
Priority: 1
Submitted By: Dipl.-Inform. Kai Hofmann (powerstat)
Assigned to: Nobody/Anonymous (nobody)
Summary: unset_var for template.inc!
Initial Comment:
Please add a method unset_var("varname/array") to the template engine.
This is required when handling blocks within blocks!!!!
Because in this situation you have sometime to clear already set variables!
Blocks within blocks can be very power- and helpfull but one ran into strange situations when no
unset_var is available.
Its 5 Minutes of work or less!
Thanks.
----------------------------------------------------------------------
>Comment By: Layne Weathers (layne_weathers)
Date: 2002-07-05 12:03
Message:
Logged In: YES
user_id=278685
You're correct, there are 2 different issues here. In the case of
embedded blocks, setting the variable to "" is adequate
because the variable is going to be reused immediately -
there's no need to destroy it and then recreate it.
On the other hand, I often use 2 Template instances to
minimize the variables parsed during long loops - in this case
I always do a full unset between loops.
FWIW, I discovered some less-than-ideal programming and
variable use when using an actual unset; setting the variable
to "" covered the problem up.
----------------------------------------------------------------------
Comment By: Dipl.-Inform. Kai Hofmann (powerstat)
Date: 2002-07-04 04:27
Message:
Logged In: YES
user_id=286352
Sorry to say, but my experience shows that it is not a
simple set_var("name","") because this is different from a
real unset() !
----------------------------------------------------------------------
Comment By: Layne Weathers (layne_weathers)
Date: 2002-04-15 10:13
Message:
Logged In: YES
user_id=278685
A unset_var() (or clear_var() as I use in my personal
extension) is simply an alias for set_var("varname", "").
Someone may get around to adding such an alias to the
official library, but it is far less urgent than many
existing bugs.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403614&aid=543468&group_id=31885
|