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;
request => $r,
class => $class,
objects => $r->objects,
+ base => $r->config->{uri_base},
# ...
);
$args{classmetadata} = {
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" );