]> git.decadent.org.uk Git - maypole.git/commitdiff
Refactor out path parsing.
authorSimon Cozens <simon@simon-cozens.org>
Thu, 1 Apr 2004 16:19:02 +0000 (16:19 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 1 Apr 2004 16:19:02 +0000 (16:19 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@102 48953598-375a-da11-a14b-00016c27c3ee

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