Peter Speltz:
> Except in my case, this solution would be evil.  No subs could be
> named after usernames.

I'm jumping in the middle of a conversation here so I may be entirely off
base, but consider this pattern from Memories:

package Memories::Tag;
use strict;
use base qw(Memories::DBI Maypole::Model::CDBI::Plain);
__PACKAGE__->columns(Essential => qw/id name/);

sub view :Exported {
    my ($self, $r) = @_;
    my $tag;
    my @tags = map { $self->search(name => $_)->first } @{$r->args};
    if (!$r->objects) { # /tag/view/sometag case
        $tag = $tags[0];
        # Here you would munge the templates
    } else { # Ordinary /tag/view/1234 case
        $tag = $r->objects->[0];
    }
    ...
}

-- 
I've looked at the listing, and it's right!
                -- Joel Halpern


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel

Reply via email to