[Catalyst] C::M::{CDBI,DBIC} vs direct Loader use?
Jules Bean
jules at jellybean.co.uk
Wed Nov 16 16:21:05 CET 2005
Brandon Black wrote:
>
> Yeah that's the opinion I was looking for I think, thanks.
The secret of good consultancy is telling someone what they want to hear :P
> 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.
I would make a custom view class as a subclass of View::TT which
overrides proccess to go through the stash before calling SUPER::process.
I have a slight preference for if (ref $_ eq 'DateTime') over a naming
convention but either could work.
Jules
More information about the Catalyst
mailing list