laziness, impatience, and hubris | |
PerlMonks |
I need help adding a new model to a legacy Catalyst setupby LittleJack (Beadle) |
on Mar 18, 2022 at 00:54 UTC ( [id://11142203]=perlquestion: print w/replies, xml ) | Need Help?? |
LittleJack has asked for the wisdom of the Perl Monks concerning the following question: I'm probably not doing this the right way, I should be generating the new model automatically through some kind of script? But it's not a 100% standard Catalyst setup, and I'm kind of in a hurry. I have a set of Models already in the site which look like this:
So I need to add another Model along the lines of:
And I'm doing it by the naïve method of putting a new OtherThing.pm into the same directory, restarting, and trying to call on it from a Controller. This doesn't work and I get [error] Caught exception in Console::Controller::OtherThing->create "Can't call method "create" on an undefined value at /var/www/Payment/Console/lib/Console/Controller/OtherThing.pm line xx." Where the undefined thing is $c->model('OtherThing') So is there some other flag or listing or module which controls which of my Models get loaded? There's a load_namespaces step in booting up Catalyst, I know that much. Happy to do it the correct way via the correct script if I can, but I need to get it working either way. I can see the Model being loaded when Catalyst starts up, by the way:
Back to
Seekers of Perl Wisdom
|
|