[Catalyst] C::M::{CDBI,DBIC} vs direct Loader use?
Perrin Harkins
perrin at elem.com
Wed Nov 16 17:40:43 CET 2005
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.
- Perrin
More information about the Catalyst
mailing list