Puneet Kishor <[EMAIL PROTECTED]> > > I am curious too... I've been using H-T for about a year and a half, > and I've never had to query the template. My assumption is that params > in the template are assigned by me, so I would automatically know what > vars exist in the template. > > What is/are a typical circumstance(s) where I would not already know > what vars exist in a template and would want to use query to find out? > > Thanks.
Querying the template allows you to be able to create another layer of abstraction between the code and the template. We use it to create a custom 'TemplateLoader' that will look at a given template, and by the naming convention that we use on the vars and loops it will actually create the SQL statements, query the database and load the templates. The only thing we have to remember is to use the nameing convention for the vars. This works for about 95% of the occassions that we use H::T and then the other %5 we use it more straight forward. The benefits of this are that if we want to add some more data to the template (an extra column or field or something) we just add the correct TMPL_VAR to the template and then the TemplateLoader does the rest. We don't have to change the code. If you're curiosity is piqued, then you can check out how we do this at cheesepizza.venzia.com. The module in question is named 'CheesePizza::TemplateLoader'. Michael Peters Venzia ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users