From: Simon Cozens Date: Sat, 24 Jan 2004 16:25:46 +0000 (+0000) Subject: Location handling stuff. X-Git-Tag: 2.10~351 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a0b702113b5a868698f65a5a88c35d91227a775f;p=maypole.git Location handling stuff. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@11 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 42d0d91..7869cfa 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -90,9 +90,7 @@ sub get_request { sub parse_location { my $self = shift; - my $uri = $self->{ar}->uri(); - my $loc = $self->{ar}->location(); - $uri =~ s/^$loc//; + my $uri = $self->{ar}->path_info(); my @pi = split /\//, $uri; shift @pi while @pi and !$pi[0]; $self->{table} = shift @pi; diff --git a/lib/Apache/MVC/View/TT.pm b/lib/Apache/MVC/View/TT.pm index f1b005e..368c3ec 100644 --- a/lib/Apache/MVC/View/TT.pm +++ b/lib/Apache/MVC/View/TT.pm @@ -26,6 +26,7 @@ sub _args { request => $r, class => $class, objects => $r->objects, + base => $r->config->{uri_base}, # ... ); $args{classmetadata} = { diff --git a/lib/BeerDB.pm b/lib/BeerDB.pm index c69e2dc..5cb320a 100644 --- a/lib/BeerDB.pm +++ b/lib/BeerDB.pm @@ -5,6 +5,8 @@ use base 'Apache::MVC'; sub handler { Apache::MVC::handler("BeerDB", @_) } BeerDB->set_database("dbi:SQLite:dbname=/opt/beer/beerdb.db"); BeerDB->config->{template_root} = "/opt/beer"; +BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/"; + BeerDB::Brewery->columns(Stringify => qw/name/); BeerDB->config->{loader}->relationship( "a brewery produces beers" );