[Catalyst] C::M::{CDBI,DBIC} vs direct Loader use?

Marcello m.romani at spinsoft.it
Wed Nov 16 17:53:50 CET 2005


Perrin Harkins ha scritto:
> On Wed, 2005-11-16 at 06:59 -0600, Brandon Black wrote:
> 
>>I've started looking into that route now... since this localization
>>should really happen generically to all DateTime objects being viewed
>>through my View, I'm kinda thinking I should override
>>Template::Stash's get() method to intercept (if ref  $_[0] eq
>>'DateTime') DateTime objects and change their timestamp before passing
>>them on to the default get().  Or adopt a naming convention like I did
>>with the database that all DateTime's to be localized end in "_stamp",
>>and grep those variables out of the stash for post-processing in a
>>subclass of Catalyst::View::TT before they get sent to Template:: at
>>all.  Or something along those lines.
> 
> 
> Most people solve this sort of issue in the template by writing a TT
> plugin (or even just a sub ref) that all the date display calls get
> wrapped by.

It's less elegant, but a TT macro will do the job too.

> 
> - Perrin
> 
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
> 


-- 
Marcello Romani
Developer
Spin s.r.l.
Reggio Emilia
http://www.spinsoft.it




More information about the Catalyst mailing list