go ahead... be a heretic | |
PerlMonks |
Re: Seeking guidance for web/db applicationby davido (Cardinal) |
on Mar 13, 2014 at 20:21 UTC ( [id://1078235]=note: print w/replies, xml ) | Need Help?? |
Make the database handle an attribute stored in the Mojolicious application class. Better yet, make a DBIx::Connector object an attribute stored in the application class. Either way, that attibute will be available from within the controller, and can then be passed to your model. See the following Mojolicious documentation that shows examples both for full Mojolicious apps, and for Mojolicious::Lite apps: https://github.com/kraih/mojo/wiki/Hypnotoad-prefork-web-server Dave
In Section
Seekers of Perl Wisdom
|
|