[Catalyst] How and where to run a method at Catalyst start up?

Tomas Doran bobtfish at bobtfish.net
Fri May 15 13:58:56 GMT 2009


Emmanuel Quevillon wrote:
> I tried to follow your advices, but unfortunately, I looks like
> MyApp->model().. does not work :
> 
> Couldn't instantiate component "MyApp::Model::Mapping", "Can't
> locate object method "model" via package "MyApp::Model::Mapping"
> ....
> 
> I also tried with $self without success :(

You're not doing what Rodrigo suggested, at all.

'model' is a method on Catalyst, therefore you need to call it on an 
object which ISA Catalyst (i.e. MyApp, or $c).

I can't really give you much more help unless you give us your _entire_ 
model code, and the controller code you're trying to call it.

Cheers
t0m




More information about the Catalyst mailing list