* Eden Cardim <[EMAIL PROTECTED]> [2007-06-04 22:15]:
> sub auto : Private {
> my($self, $c) = @_;
> push @{$c->stash->{controllers}}, $self->namespace;
> return 1;
> }
>
> # in Root
> sub end : Private {
> my($self, $c) = @_;
> $c->stash{controller} = $c->stash->{controllers}[0];
> }
Not that this is the best way to do it (see Matt’s post for
that), but if you’re always going to pick the bottom element,
why’re you using a stack at all?
sub auto : Private {
my ( $self, $c ) = @_;
$c->stash->{ controller } ||= $self->namespace;
return 1;
}
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/