]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
components now work
[maypole.git] / lib / Maypole.pm
index ae2ae58cd1b7046f6eb58cbcbbfc5542a1a6677e..83607c8db34137662cf0694cf8a494179d319d18 100644 (file)
@@ -481,18 +481,24 @@ request. You'll need to set up actions and templates
 which return fragments of HTML rather than entire pages, but once you've
 done that, you can use the C<component> method of the Maypole request object
 to call those actions. You may pass a query string in the usual URL style.
+
 You should not fully qualify the Maypole URLs.
 
+Note: any HTTP POST or URL parameters passed to the parent are not passed to the
+component sub-request, only what is included in the url passed as an argyument
+to the method
+
 =cut
 
 sub component {
     my ( $r, $path ) = @_;
-    my $self = bless { parent => $r }, ref $r;
+    my $self = bless { parent => $r, config => $r->{config}, template_args => {}, }, ref $r;
+    $self->get_user;
     my $url = URI->new($path);
+    warn "path : $path\n";
     $self->{path} = $url->path;
     $self->parse_path;
     $self->params( $url->query_form_hash );
-    $self->query( $r->params );
     $self->handler_guts;
     return $self->output;
 }
@@ -592,7 +598,7 @@ sub handler_guts
       if ( my $error = $@ ) 
         {
          $status = $self->call_exception($error, "model");
-         if ( $status != OK ) 
+         if ( $status != OK )
             {
              warn "caught model error: $error";
              return $self->debug ?