Gantry::Stash::View - Stash object for the view


Gantry documentation Contained in the Gantry distribution.

Index


Code Index:

NAME

Top

Gantry::Stash::View - Stash object for the view

SYNOPSIS

Top

    $self->stash->view->title( 'Your Browser Window Title Here' );
    $self->stash->view->template( 'some_template.template' );
    $self->stash->view->data( { } ); # the hash goes to template's proccessor

DESCRIPTION

Top

Gantry builds the stash view for you in its handler. Fill in values as shown above to communicate with your template and/or your template engine.

METHODS

Top

template
data
title

MODULES

Top

Gantry::Stash::View::Form

SEE ALSO

Top

Gantry(3), Gantry::Stash(3), Gantry::Stash::View::Form(3)

LIMITATIONS

Top

AUTHOR

Top

Phil Crow <pcrow@sunflowerbroadband.com> Tim Keefer <tkeefer@gmail.com>

COPYRIGHT and LICENSE

Top


Gantry documentation Contained in the Gantry distribution.

package Gantry::Stash::View;
package view;
use strict;

use Gantry::Stash::View::Form;
  
#-------------------------------------------------
# AUTOLOAD 
#-------------------------------------------------
sub AUTOLOAD {
    my $self    = shift;
    my $command = our $AUTOLOAD;
    $command    =~ s/.*://;

    die( "Undefined stash->view method $command" );
}

#-------------------------------------------------
# DESTROY
#-------------------------------------------------
sub DESTROY { }
                
#-------------------------------------------------
# new 
#-------------------------------------------------
sub new {
    my $class   = shift;
    my $self    = bless( {}, $class );
    return $self;

} # end new

#-------------------------------------------------
# template( value )
#-------------------------------------------------
sub template {
    my( $self, $p ) = ( shift, shift );

    $self->{__TEMPLATE__} = $p if defined $p;
    return( $self->{__TEMPLATE__} );

} # end template

#-------------------------------------------------
# data( value )
#-------------------------------------------------
sub data {
    my( $self, $p ) = ( shift, shift );

    $self->{__DATA__} = $p if defined $p;
    return( $self->{__DATA__} );

} # end data

#-------------------------------------------------
# title( value )
#-------------------------------------------------
sub title {
    my( $self, $p ) = ( shift, shift );

    $self->{__TITLE__} = $p if defined $p;
    return( $self->{__TITLE__} );
    
} # end title

#-------------------------------------------------
# form( value )
#-------------------------------------------------
sub form {
    my( $self, $p ) = ( shift, shift );

    $self->{__FORM__} = form->new( $p ) if defined $p;

    $self->{__FORM__} = form->new( ) unless defined $self->{__FORM__};

    return( $self->{__FORM__} );
}

1;

__END__