Catalyst::View - Catalyst View base class


Catalyst-Runtime documentation Contained in the Catalyst-Runtime distribution.

Index


Code Index:

NAME

Top

Catalyst::View - Catalyst View base class

SYNOPSIS

Top

    package Catalyst::View::Homebrew;

    use base qw/Catalyst::View/;

    sub process {
    # template processing goes here.
    }

DESCRIPTION

Top

This is the Catalyst View base class. It's meant to be used as a base class by Catalyst views.

As a convention, views are expected to read template names from $c->stash->{template}, and put the output into $c->res->body. Some views default to render a template named after the dispatched action's private name. (See Catalyst::Action.)

METHODS

Top

Implements the same methods as other Catalyst components, see Catalyst::Component

process

gives an error message about direct use.

AUTHORS

Top

Catalyst Contributors, see Catalyst.pm

COPYRIGHT

Top


Catalyst-Runtime documentation Contained in the Catalyst-Runtime distribution.
package Catalyst::View;

use Moose;
extends qw/Catalyst::Component/;

sub process {

    Catalyst::Exception->throw( message => ( ref $_[0] || $_[0] ).
            " directly inherits from Catalyst::View. You need to\n".
            " inherit from a subclass like Catalyst::View::TT instead.\n" );

}

no Moose;
__PACKAGE__->meta->make_immutable();

1;