> > Personally, I compare each template with a function. The {use} variables
> > are the function arguments. I think all the solutions we proposed are
> > used in one or another way in a programming language.
>
> Yes, this is what I do as well. Can you give me examples of the original
> three proposals in programming languages? The last two have parallels to
> programming languages except you don't know in which context your template
> will be called and so don't know which globals will be available....
Solution 1, 2, and 3 can be seen as a nested function definition.
def template_p(a,b,c,d,e,f):
def template_q(a):
print a
def template_r():
print b
print c
Function template_p is called from the user application; thus has all
variables. template_p does an {include "template_q" send a}. That template
includes template_r. All those sub-includes have access to the variables from
the top function scope.
@Derick: Not knowing where variables come from..
In every function you write and look at the parameters, it is unknown where
those variables come from. You have to lookup the caller to see.
function template_p($a, $b)
{
}
---
$b = $this->bla + 1;
template_p($this->bla, $b)
Raymond.
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components