[jifty-devel] Correct place to put GUI helper subroutines

Andrew Sterling Hanenkamp sterling at hanenkamp.com
Wed Nov 28 10:40:12 EST 2007


I typically create utility classes that I load to use for common functions:

package MyApp::Util::Date;

require Exporter;
push our @ISA, 'Exporter';

our @EXPORT = qw( pretty_date );

sub pretty_date {
}

# and later

package MyApp::Model::Entry;

use MyApp::Util::Date;

sub show_start_end_date {
    my $self = shift;
    Jifty->web->out(pretty_date($self->start_date) . ' - ' .
pretty_date($self->end_date));

Cheers,
Andrew

On Nov 27, 2007 8:47 AM, Henry Baragar <Henry.Baragar at instantiated.ca>
wrote:

> Hello,
>
> I have a few help subroutines (e.g. prettyDate) that are used across
> models
> throughout the system.  Where is the appropriate place to put these
> subroutines?
>
> In other Mason applications, we have put them in the autohandler.  Is this
> the
> correct place in Jifty?
>
> Regards,
> Henry
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20071128/8bac7c2c/attachment.htm


More information about the jifty-devel mailing list