
CGI::Mungo - Very simple CGI web framework

use CGI::Mungo;
my $options = {
'responsePlugin' => 'Some::Class'
};
my $m = CGI::Mungo->new($options);
my $actions = {
"default" => sub{}, #do nothing
"list" => \&someSub(), #use a named sub
"add" => sub{my $var = 1;} #use an anonymous sub
};
$m->setActions($actions);
$m->run(); #do this thing!

All action subs are passed a CGI::Mungo object as the only parameter, from this you should be able to reach everything you need.

new()
my $options = { 'responsePlugin' => 'Some::Class', 'checkReferer' => 0 }; my $m = CGI::Mungo->new($options);Constructor, requires a hash references to be passed as the only argument. This hash reference contains any general options for the framework.
getResponse()
my $response = $m->getResponse();Returns an instance of the response plugin object, previously defined in the constructor options. See CGI::Mungo::Response for more details.
getSession()
my $session = $m->getSession();Returns an instance of the <CGI::Mungo::Session> object.
getRequest()
my $request = $m->getRequest();Returns an instance of the CGI::Mungo::Request object.
setActions()
my %actions = ( 'default' => \&showMenu(). 'list' => \%showList() ) $m->setActions(\%actions);Sets the actions of the web application using a hash reference. The names of the keys in the hash reference will match the value of the given "action" form field from the current request. Hash reference values can be references to subs or annoymous subs.
getAction()
my $action = $m->getAction();Returns the curent action that the web application is performing. This is the current value of the "action" request form field.
run()
$m->run();This methood is required for the web application to deal with the current request. It should be called after any setup is done.
getThisUrl()
my $url = $m->getThisUrl();Returns the full URL for the current script.

To change the session prefix characters use the following code at the top of your script:
$CGI::Mungo::Session::prefix = "ABC";

MacGyveR <dumb@cpan.org>
Development questions, bug reports, and patches are welcome to the above address

Copyright (c) 2009 MacGyveR. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.