]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
Refactor out path parsing.
[maypole.git] / lib / Maypole.pm
index 20a3c0e02f14c8593e824fdd9c59ce310a3a9320..fd11fbe9d3862760bfeacd4398ca5604bb1218f0 100644 (file)
@@ -118,6 +118,16 @@ sub additional_data {}
 
 sub authenticate { return OK }
 
+sub parse_path {
+    my $self = shift;
+    $self->{path} ||= "frontpage";
+    my @pi = split /\//, $self->{path};
+    shift @pi while @pi and !$pi[0];
+    $self->{table} = shift @pi;
+    $self->{action} = shift @pi;
+    $self->{args} = \@pi;
+}
+
 =head1 NAME
 
 Maypole - MVC web application framework