package Apache::MVC;
-use base 'Maypole';
+
+use base qw(Apache::MVC::Base Maypole);
use Apache;
use Apache::Request;
use strict;
use warnings;
+
our $VERSION = "0.3";
sub get_request {
- shift->{ar} = Apache::Request->new(Apache->request);
+ shift->{ar} = Apache::Request->new( Apache->request );
}
-sub parse_location {
+sub parse_args {
my $self = shift;
- $self->{path} = $self->{ar}->uri;
- my $loc = $self->{ar}->location;
- no warnings 'uninitialized';
- $self->{path} =~ s/^($loc)?\///;
- $self->parse_path;
-
$self->{params} = { $self->{ar}->content };
- while (my ($key, $value) = each %{$self->{params}}) {
- $self->{params}{$key} = '' unless defined $value;
+ while ( my ( $key, $value ) = each %{ $self->{params} } ) {
+ $self->{params}{$key} = '' unless defined $value;
}
- $self->{query} = { $self->{ar}->args };
-}
-
-sub send_output {
- my $r = shift;
- $r->{ar}->content_type($r->{content_type});
- $r->{ar}->headers_out->set("Content-Length" => length $r->{output});
- $r->{ar}->send_http_header;
- $r->{ar}->print($r->{output});
-}
-
-sub get_template_root {
- my $r = shift;
- $r->{ar}->document_root . "/". $r->{ar}->location;
+ $self->{query} = { $self->{ar}->args };
}
1;
=head1 AUTHOR
Simon Cozens, C<simon@cpan.org>
+Screwed up by Sebastian Riedel, C<sri@oook.de>
=head1 LICENSE