From: Simon Cozens Date: Thu, 1 Apr 2004 16:19:02 +0000 (+0000) Subject: Refactor out path parsing. X-Git-Tag: 2.10~260 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=2009ec81c3cc790cbdc42082c459cf57bdccedad;p=maypole.git Refactor out path parsing. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@102 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 20a3c0e..fd11fbe 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -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