added model and controller
[catagits/CatalystX-Declare.git] / lib / CatalystX / Declare / Keyword / View.pm
CommitLineData
8e5d9092 1use MooseX::Declare;
2
3class CatalystX::Declare::Keyword::View
4 extends CatalystX::Declare::Keyword::Component {
5
6 method default_superclasses { 'Catalyst::View' }
7}
8
9__END__
10
11=head1 NAME
12
13CatalystX::Declare::Keyword::View - Declare Catalyst Views
14
15=head1 SYNOPSIS
16
17 use CatalystX::Declare;
18
19 view MyApp::Web::View::Example
20 extends Catalyst::View::TT
21 with MyApp::Web::ViewRole::Caching {
22
23 after process (Object $ctx) {
24 $ctx->log->debug('done processing at ' . time)
25 if $ctx->debug;
26 }
27 }
28
29=head1 DESCRIPTION
30
31This handler is a direct extension of L<CatalystX::Declare::Keyword::Component>
32and provides a C<view> keyword to declare a catalyst view. Currently, the only
33things this declaration does is setting up a L<Moose> class like
34L<MooseX::Declare> does, provide L<CLASS> to its scope and default the
35superclass to L<Catalyst::View>.
36
37See L<MooseX::Declare/class> for more information on this kind of keyword.
38Since views do not take actions, no special handling of roles is required,
39other than with controller roles. So if you want to write roles for views,
40simply use the L<MooseX::Declare/role> syntax.
41
42=head1 SUPERCLASSES
43
44=over
45
46=item L<CatalystX::Declare::Keyword::Component>
47
48=back
49
50=head1 METHODS
51
52These methods are implementation details. Unless you are extending or
53developing L<CatalystX::Declare>, you should not be concerned with them.
54
55=head2 default_superclasses
56
57 List[Str] Object->default_superclasses ()
58
59Defaults to L<Catalyst::View>.
60
61=head1 SEE ALSO
62
63=over
64
65=item L<CatalystX::Declare>
66
67=item L<CatalystX::Declare::Keyword::Component>
68
69=item L<MooseX::Declare/class>
70
71=back
72
73=head1 AUTHOR
74
75See L<CatalystX::Declare/AUTHOR> for author information.
76
77=head1 LICENSE
78
79This program is free software; you can redistribute it and/or modify it under
80the same terms as perl itself.
81
82=cut