[Belfast-pm] Template Toolkit, passing in a hash?

alan pearson alandpearson at yahoo.com
Tue Jul 6 04:27:51 CDT 2004


So is the hash they generate passed in as a reference
or do they return (Ughhh) one of their  local hashes ?

Why not wrap the call to the Calculate function with
an if ($FreshStats), or at the top of the function
chech if the last time is called is older than the
refresh interval ??

PS got the video and photos.... you do look spiffing
!!!

--- Simon McCartney <simon at thebreakfasttable.com>
wrote: > I've been playing with TT on Debian, I've
used it to
> prototype some stuff
> using DBI calls in the template, but I want to move
> to the next level.
> (I'm using Apache, MySQL & have the handler
> registered etc)
> 
> I have a couple of routines that generate a hash of
> information, and I want
> to display these in the processed template.
> 
> My understanding is that I would pass the hash in
> using $vars in the
> process method. But this means that the calculations
> take place for every
> page served by that handler, hardly efficient.
> 
> My next option would be to pass the subroutine in
> and only call it when
> needed in the template.  But this means changing my
> handler everytime I
> want to add a new subroutine to the module.
> 
> Is there a better way? Am I missing something?
> I guess I want to be able to use it as a plugin
> without writing a
> plugin..is a plugin the correct way to go?
> 
> Thanks,
> 
> Simon.
> 
> -- 
> Simon McCartney
> simon at thebreakfasttable.com
> 

> ATTACHMENT part 1.2 application/pgp-signature 
> _______________________________________________
> Belfast-pm mailing list
> Belfast-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/belfast-pm
>  


	
	
		
___________________________________________________________ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself http://uk.messenger.yahoo.com



More information about the Belfast-pm mailing list