CGI::Lazy::Plugin - CGI::Lazy::Plugin documentation


CGI-Lazy documentation Contained in the CGI-Lazy distribution.

Index


Code Index:

LEGAL

Top

NAME

Top

CGI::Lazy::Plugin

SYNOPSIS

Top

	use CGI::Lazy;

	my $q = CGI::Lazy->new('/path/to/config/file');

DESCRIPTION

Top

Internal module used for tracking which pieces of CGI::Lazy are being used. Plugins are enabled or excluded in the config file.

METHODS

Top

config ( )

Returns CGI::Lazy::Config object.

q ()

Returns CGI::Lazy object

new ( q )

Constructor

q

CGI::Lazy Object


CGI-Lazy documentation Contained in the CGI-Lazy distribution.

package CGI::Lazy::Plugin;

use strict;

use CGI::Lazy::Globals;

#-------------------------------------------------------------------------------
sub AUTOLOAD {
	my $self = shift;

	my $name = our $AUTOLOAD;
	return if $name =~ /::DESTROY$/;
	my @list = split "::", $name;
	my $value = pop @list;

	if (@_) {
		return $self->{_plugins}->{$value} = shift; 
	} else {
		return $self->{_plugins}->{$value}; 
	}
}
#------------------------------------------------------------
sub config {
	my $self = shift;

	return $self->q->config;
}

#------------------------------------------------------------
sub q {
	my $self = shift;

	return $self->{_q};
}

#------------------------------------------------------------
sub new {
	my $class = shift;
	my $q = shift;

	my $self = bless {_q => $q}, $class;

	$self->{_plugins} = $self->config->plugins;

	return $self; 
}

1

__END__