PDA

View Full Version : <if> tags...


Carnage
06-29-2005, 08:48 PM
I find the <if> tags in vb templates really quite useful and want to use them in another totally unrelated site i'm building... I looked at the vb code to try and work out how/if it was parsing them but drew a blank. They seem to be done serverside since they don't turn up int the source. Is it safe just to drop them into a html page and presume they will be evaluated correctly?

filburt1
06-29-2005, 09:20 PM
It pseudo-compiles them to runtime PHP code with inline ifs.

While I've never used it, I've heard good things about the template engine "Smarty." You may want to look into that.

Carnage
06-29-2005, 10:54 PM
how?

Carnage
07-06-2005, 11:46 PM
yay i figured it. could have pointed me in the directin of the templates stored in the db thou... Anyway, for anyone else wondering how its done. it changes the <if> tag into:

"template". (($condition) ? ("true") : ("false")) ."template continues"