On Fri, 2005-11-18 at 09:05 +0000, Aaron Trevena wrote:
> On 11/18/05, Aaron Trevena <[EMAIL PROTECTED]> wrote:
> > in one of my model classes...
> >
> > foreach my $page (__PACKAGE__->retrieve_all()) {
> > my $name = $page->name;
> > no strict qw/refs/;
> > *{__PACKAGE__.'::'.$name} = sub : Exported {
> > my ($self, $r) = @_;
> > my ($content) = __PACKAGE__->search(name=>$r->{args}->[0]);
> > $r->objects([$content]);
> > $r->template('content/view');
> > return;
> > }
> > }
> >
> > evil or enlightened?
>
> .. broken it seems..
>
> foreach my $page (__PACKAGE__->retrieve_all()) {
> my $name = $page->name;
> no strict qw/refs/;
> *{__PACKAGE__.'::'.$name} = sub : Exported {
> my ($self, $r) = @_;
> my $search_name = $r->action;
> my ($content) = __PACKAGE__->search(name=>$search_name);
> $r->objects([$content]);
> $r->template_args->{content} = $content;
> $r->template('content/view');
> $r->{ar}->warn("content : $content");
> return;
> }
> }
>
> ..however this works correctly
>
> so I can have url.to/Information/about and it Does The Right Thing (TM)
You've lost me. What is The Right Thing here? You appear to have some
table with not too many rows and be constructing lots of closures. Is
this roughly equivalent to what would be achieved by:
beerdb/Information/view/about
in standard Maypole (assuming name is your PK)?
Cheers, Dave
-------------------------------------------------------
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