1 package Maypole::Components;
9 my ($class,$r, $path) = @_;
10 my $self = bless { config => $r->config, parent => $r }, $class;
15 my $url = URI->new($path);
16 $self->{path} = $url->path;
18 $self->{query} = $url->query_form_hash;
20 return $self->{output};
23 sub get_template_root { shift->{parent}->get_template_root }
24 sub view_object { shift->{parent}->view_object }
31 Maypole::Components - Run Maypole sub-requests as components
40 [% request.component("/beer/view_as_component/20") %]
44 This subclass of Maypole allows you to integrate the results of a Maypole
45 request into an existing request. You'll need to set up actions and templates
46 which return fragments of HTML rather than entire pages, but once you've
47 done that, you can use the C<component> method of the Maypole request object
48 to call those actions. You may pass a query string in the usual URL style.
49 You should not fully qualify the Maypole URLs.
53 http://maypole.perl.org/
57 Simon Cozens, E<lt>simon@cpan.orgE<gt>
59 =head1 COPYRIGHT AND LICENSE
61 Copyright 2004 by Simon Cozens