Commit | Line | Data |
8e5d9092 |
1 | use MooseX::Declare; |
2 | |
3 | class 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 | |
13 | CatalystX::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 | |
31 | This handler is a direct extension of L<CatalystX::Declare::Keyword::Component> |
32 | and provides a C<view> keyword to declare a catalyst view. Currently, the only |
33 | things this declaration does is setting up a L<Moose> class like |
34 | L<MooseX::Declare> does, provide L<CLASS> to its scope and default the |
35 | superclass to L<Catalyst::View>. |
36 | |
37 | See L<MooseX::Declare/class> for more information on this kind of keyword. |
38 | Since views do not take actions, no special handling of roles is required, |
39 | other than with controller roles. So if you want to write roles for views, |
40 | simply 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 | |
52 | These methods are implementation details. Unless you are extending or |
53 | developing L<CatalystX::Declare>, you should not be concerned with them. |
54 | |
55 | =head2 default_superclasses |
56 | |
57 | List[Str] Object->default_superclasses () |
58 | |
59 | Defaults 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 | |
75 | See L<CatalystX::Declare/AUTHOR> for author information. |
76 | |
77 | =head1 LICENSE |
78 | |
79 | This program is free software; you can redistribute it and/or modify it under |
80 | the same terms as perl itself. |
81 | |
82 | =cut |