[Catalyst] use base or use parent?
Dermot
paikkos at googlemail.com
Tue Jun 24 17:18:23 BST 2008
Hi,
I have a controller with
use parent 'Catalyst::Controller';
I can't find any info on 'parent'
I want to use FormBuilder and tried to use it like so
use parent 'Catalyst::Controller';
use base qw(Catalyst::Controller::FormBuilder);
FormBuilder sends debug messages to the server but my controller can't
locate the method:
[error] Caught exception in MyApp::Controller::Submissions->edit
"Can't locate object method "form" via package "MyApp" at line 47
sub edit : Local Form {
my ($self, $c, $id) = @_;
my $sub = $c->model('MyAppDB::Submissions')->find({id => $id});
if ($c->form->submitted && $c->form->validate) {
$sub->name($c->form->field('name'));
$c->stash->{message} = 'Updated'.$sub->name;
$c->forward('list');
}
...snip
I think this is a problem of inheritance. Can any one advise?
Thanx,
Dp.
More information about the Catalyst
mailing list