1 package Catalyst::View::Component::SubInclude::Visit;
6 use namespace::clean qw/croak/;
10 Catalyst::View::Component::SubInclude::Visit - visit() plugin for C::V::Component::SubInclude
18 our $VERSION = '0.02';
24 package MyApp::View::TT;
27 extends 'Catalyst::View::TT';
28 with 'Catalyst::View::Component::SubInclude';
30 __PACKAGE__->config( subinclude_plugin => 'Visit' );
32 Then, somewhere in your templates:
34 [% subinclude('/my/widget') %]
38 C<Catalyst::View::Component::SubInclude::Visit> uses C<< $c->visit() >> to
39 render subinclude contents.
41 This method is only supported when using L<Catalyst> version 5.71000 or newer.
45 =head2 C<generate_subinclude( $c, $path, @args )>
47 This will translate to the following call:
49 $c->visit( $path, @args );
53 sub generate_subinclude {
54 my ($class, $c, $path, @params) = @_;
56 croak "subincludes through visit() require Catalyst version 5.71000 or newer"
57 unless $c->can('visit');
59 $c->visit( $path, @params );
65 L<Catalyst::View::Component::SubInclude|Catalyst::View::Component::SubInclude>,
70 Nilson Santos Figueiredo Junior, C<< <nilsonsfj at cpan.org> >>
74 Development sponsored by Ionzero LLC L<http://www.ionzero.com/>.
76 =head1 COPYRIGHT & LICENSE
78 Copyright (C) 2009 Nilson Santos Figueiredo Junior.
80 Copyright (C) 2009 Ionzero LLC.
82 This program is free software; you can redistribute it and/or modify it
83 under the same terms as Perl itself.