Posted By:
Zenaan_Harkness
Posted On:
Saturday, February 21, 2004 04:46 PM
Well, such templates, if you want them, are one-liners. It is instructional to write them yourself too - so you grok it better. Anyway, here are some examples from me, as a result of my going through the StringTemplates tutorial. I particularly like the mailto.st one-liner, as it is definitely simpler and shorter to use it, than to manually type out a
link.
I would like to see a good full table example though - one that separately unrolls table data items for each row. Perhaps I just need to read the docs again?
Finally, at least in the version I downloaded (2.7.2), the facility to add an integer to the loop counter variable (i) does not work (nor does subtraction). To counter that, it starts at 1 rather than zero. But it seems a little limiting. I guess the "controller" code needs to implement such things if such variations are needed...
HTH,
Zen
$ cat b.st
$attr$
$ cat i.st
$attr$
$ cat link.st
$title$
$ cat mailto.st
$email$
$ cat oli.st
$i$. $attr$
$ cat td.st
$attr$ |