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)
A.
-------------------------------------------------------
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_idv28&alloc_id845&op=click
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel