Catalyst::Model::Handel::Cart - Base class for Handel cart classes
package MyApp::Model::Cart; use strict; use warnings; BEGIN { use base qw/Catalyst::Model::Handel::Cart/; }; __PACKAGE__->config( connection_info => ['dbi:mysql:localhost', 'user', 'pass'] ); # in your cat constrollers my $cart = $c->model('Cart')->create({ name => 'My Cart' });
Catalyst::Model::Handel::Cart is the base class for all Handel cart related models in a Catalyst application. It takes care of loading the specified cart class and configuring it based on any configuration options set in the model class or application config file.
You can configure your model in one of two ways. First, you can set options within your model class itself:
package MyApp::Model::Cart; use strict; use warnings; BEGIN { use base qw/Catalyst::Model::Handel::Cart/; }; __PACKAGE__->config( connection_info => ['dbi:mysql:localhost', 'user', 'pass'] );
You can also specify configuration on your application config file:
Model::Cart: connection_info: - dbi:mysql:localhost - user - pass
All connection options are passed into the current cart classes storage object. See Handel::Storage and Handel::Storage::DBIC for the available configuration options.
If no cart_class is specified, Handel::Cart will be used by default.
Once loaded, all method requests to this model are forwarded to the specified cart class.
See Catalyst::Component for more information.
This is a placeholder to forward calls to new to the cart manager (should it actually have it's own new method) rather than exposing new from Catalyst::Component.
new
Handel::Cart, Handel::Storage, Handel::Storage::DBIC
Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/
To install Handel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Handel
CPAN shell
perl -MCPAN -e shell install Handel
For more information on module installation, please visit the detailed CPAN module installation guide.