CatalystX::Declare::Keyword::View - Declare Catalyst Views


CatalystX-Declare documentation Contained in the CatalystX-Declare distribution.

Index


Code Index:

NAME

Top

CatalystX::Declare::Keyword::View - Declare Catalyst Views

SYNOPSIS

Top

    use CatalystX::Declare;

    view MyApp::Web::View::Example
        extends Catalyst::View::TT 
        with    MyApp::Web::ViewRole::Caching {

        after process (Object $ctx) {
            $ctx->log->debug('done processing at ' . time)
                if $ctx->debug;
        }
    }

DESCRIPTION

Top

This handler is a direct extension of CatalystX::Declare::Keyword::Component and provides a view keyword to declare a catalyst view. Currently, the only things this declaration does is setting up a Moose class like MooseX::Declare does, provide CLASS to its scope and default the superclass to Catalyst::View.

See class in MooseX::Declare for more information on this kind of keyword. Since views do not take actions, no special handling of roles is required, other than with controller roles. So if you want to write roles for views, simply use the role in MooseX::Declare syntax.

SUPERCLASSES

Top

CatalystX::Declare::Keyword::Component

METHODS

Top

These methods are implementation details. Unless you are extending or developing CatalystX::Declare, you should not be concerned with them.

default_superclasses

    List[Str] Object->default_superclasses ()

Defaults to Catalyst::View.

SEE ALSO

Top

CatalystX::Declare
CatalystX::Declare::Keyword::Component
class in MooseX::Declare

AUTHOR

Top

See AUTHOR in CatalystX::Declare for author information.

LICENSE

Top

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.


CatalystX-Declare documentation Contained in the CatalystX-Declare distribution.

use MooseX::Declare;

class CatalystX::Declare::Keyword::View
    extends CatalystX::Declare::Keyword::Component {

    method default_superclasses { 'Catalyst::View' }
}

__END__