velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yura Ushakhow <y...@excimer.ru>
Subject Re: Context & variables in templates
Date Tue, 17 Dec 2002 11:16:28 GMT
>> Kind people, need your help. How could I ask velocity if mytpl.vm has 
>> reference to $myvar inside , before merging? I need it, to know what 
>> context user wants instead of generating everything, - just the parts 
>> it needs.
> That's usually an inversion of things - the controller usually has a 
> clue...

> In contrib/temporary/templatetool you'll find a little (unsupported) 
> class that will return to you a list of references... see if that helps...
Much thanks, Geir! Very grateful.

Speaking of inversion of things, it might be - idealogy-wise. Though I 
cannot think of another way to do it. Say, there might be a variable in 
templates which, to fill itself with data, must poke a SQL server for a 
large request. But whether web-designer wants to use that variable or 
not depends on him. So you can clearly see that it saves great a time, 
if he (designer) doesn't really use it.

By the by, if I'm not mistaken, there was a name to such way, think it 
was called "Pull-model" ? I.e., when designer tells the controller what 
he wants. Don't remember precisely.

Anyhow, much appreciate your help!
Yura.


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message