| Handel documentation | Contained in the Handel distribution. |
Handel - A cart/order/checkout framework with AxKit/TT/Catalyst support
use Handel;
Handel->config_class('My::ConfigReader');
my $config = Handel->config;
# $config->isa('My::ConfigReader')
This is a generic class containing the default configuration used by other Handel classes.
To learn more about what Handel is and how it works, take a look at the manual (Handel::Manual).
Gets/sets the name of the configuration class to use. The default configuration class is Handel::ConfigReader.
A Handel::Exception exception will be thrown if the specified class can not be loaded.
Returns an instance of the specified configuration class.
Christopher H. Laco
CPAN ID: CLACO
claco@chrislaco.com
http://today.icantfocus.com/blog/
| Handel documentation | Contained in the Handel distribution. |
# $Id$ package Handel; use strict; use warnings; use vars qw/$VERSION/; $VERSION = '1.00013'; BEGIN { use base qw/Class::Accessor::Grouped/; use Handel::Exception qw/:try/; use Handel::L10N qw/translate/; }; __PACKAGE__->config_class('Handel::ConfigReader'); sub config_class { my ($self, $config_class) = @_; if ($config_class) { eval "require $config_class"; ## no critic throw Handel::Exception( -details => translate('The config_class [_1] could not be loaded', $config_class) ) if $@; ## no critic $self->set_inherited('config_class', $config_class); }; return $self->get_inherited('config_class'); }; sub config { return shift->config_class->instance; }; 1; __END__