[Catalyst] Problem with objects

Tomas Doran bobtfish at bobtfish.net
Wed May 13 18:22:33 GMT 2009


Naylor Garcia wrote:
> I am creating a sub in the Model/IMAP.pm makes no connection with the 
> database, but performs authentication via IMAP. But failing to call this 
> sub in the controller.
> 
> I am new to Catalyst and appreciate the help.

Hi.

Sorry, but you haven't explained what you're actually trying to achieve 
here.

Maybe it would help if you showed us the code you're trying to call, and 
how you're trying to call it.

You would generally say:

package MyApp::Model::Foo;
use base qw/Catalyst::Model/;

sub my_method { 'fnar' }

package MyApp::Controller::Foo;
use base qw/Catalyst::Controller/;

sub something : Local {
     my ($self, $c) = @_;
     $c->model('Foo')->my_method;
}

Does that help?

Cheers
t0m



More information about the Catalyst mailing list