CGI-Application-Plugin-FormState

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/FormState.pm  view on Meta::CPAN

use warnings;
use strict;

use CGI::Application;
use CGI::Session::ID::md5;
use CGI::Application::Plugin::Session;
use vars qw(@ISA @EXPORT);


use Carp;
use Scalar::Util qw(weaken isweak);

use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(form_state);

our $CGIAPP_Namespace     = '__CAP_FORM_STATE';
my  $Default_Expires      = '2d';
my  $Default_Storage_Name = 'cap_form_state';

sub import {

lib/CGI/Application/Plugin/FormState.pm  view on Meta::CPAN

        '__CGIAPP_OBJ'   => $webapp,
        '__STORAGE_NAME' => undef,
        '__STORAGE_HASH' => undef,
        '__STORAGE_KEY'  => undef,
        '__EXPIRES'      => undef,
        '__CONFIGURED'   => undef,
    };

    # Force reference to CGI::Application object to be weak to avoid
    # circular references
    weaken($self->{'__CGIAPP_OBJ'});

    return bless $self, $class;
}

sub form_state {
    my ($self) = @_;

    # It's possible that in the future we will allow named configs, e.g.
    #    $self->form_state('foo')->param('bar);



( run in 0.332 second using v1.01-cache-2.11-cpan-65fba6d93b7 )