RE: [Zope] The logic of the _ variable (Q1959)
16 Sep
1999
16 Sep
'99
6:55 p.m.
Here's some basics, to the best of my understanding:
<dtml-var x> and <dtml-var "_['x']"> should always be identical, and should render 'x'. If 'x' is a function or method, it will be called. You can also spell this <dtml-var "_.getitem('x', 1)">
In some ways right. <dtml-var expr="_.render(_['x'])"> looks in the current Document Template namespace for a variable named 'x' and renders it fully. There's a fair amount of magic to the use of <dtml-var x> (aka <dtml-var name="x">) if x is a DTML Document/Method that you would otherwise have to get at with <dtml-var expr="x(_,_.None)">. <dtml-var expr="_['x']"> does not automatically call a function/method. It mearly looks up the object with the id of 'x' out of the _ namespace.
9700
Age (days ago)
9700
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jeffrey Shell