| Gantry documentation | Contained in the Gantry distribution. |
Gantry::Stash - Main stash object for Gantry
This object is created for you by the handler in the base module.
Use this module to store and retrieve things in the stash (which is good for one web page hit). Example:
$self->stash->view->title( 'Browser Title Bar Text Here' );
Makes a new empty stash object. Don't try to pass it anything.
Returns the 'view' stash object
Returns the 'controller' stash object
Gantry, Gantry::Stash::View, Gantry::Stash::Controller
Phil Crow <pcrow@sunflowerbroadband.com>
Tim Keefer <tkeefer@gmail.com>
Copyright (c) 2005, Phil Crow.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
| Gantry documentation | Contained in the Gantry distribution. |
package Gantry::Stash; package stash; use strict; use Gantry::Stash::View; use Gantry::Stash::Controller; #------------------------------------------------- # AUTOLOAD #------------------------------------------------- sub AUTOLOAD { my $self = shift; my $command = our $AUTOLOAD; $command =~ s/.*://; die( "Undefined stash method: $command" ); } # end AUTOLOAD #------------------------------------------------- # DESTROY #------------------------------------------------- sub DESTROY { } #------------------------------------------------- # new #------------------------------------------------- sub new { my $class = shift; my $self = bless( {}, $class ); return $self; } # end new #------------------------------------------------- # view #------------------------------------------------- sub view { my $self = shift; $self->{__VIEW__} = view->new() unless defined $self->{__VIEW__}; return $self->{__VIEW__}; } # end view #------------------------------------------------- # controller #------------------------------------------------- sub controller { my $self = shift; $self->{__CONTROLLER__} = controller->new() unless defined $self->{__CONTROLLER__}; return $self->{__CONTROLLER__}; } # end controller 1; __END__