Hi,
I have the following 2 class structure. I am unable to access the $c in
get_name subroutine called from subroutine site_name of
Myapp::Controller::Sites::Configuration. Can anyone help, how can I access the
$c if I am call a subroutine directly not by dispatching the call
!ackage Myapp::Controller::Sites;
use Moose;
use namespace::autoclean;
BEGIN {
BEGIN {extends 'Catalyst::Controller'; }
}
has 'id' => (
is => 'rw',
isa => 'Int'
);
sub get_name {
my ($self, $c) = @_;
my $rs = $c->model(DB::Sites)->find($self->id);
return $rs->name;
}
package Myapp::Controller::Sites::Configuration;
use Moose;
use namespace::autoclean;
BEGIN {
extends 'GISTFIND::Controller::Site';
}
sub site_name : Local {
my($self, $c) = @_;
my $obj = Site->new({id => 3});
$name = $obj->get_name;
}
Genius at work
Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!
http://downloads.yahoo.com/in/internetexplorer/_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/