X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FBeer.pod;h=a1c85f20297ec793cafaf12eb43fdc75fb40ea75;hb=13c3c3ffef691cfc461e88ac9a9e6cef65a15a8f;hp=033d9ce1acb8e10dc9f2d52a49c257b71757bc7b;hpb=616082000cbe7305fbfc84d33bb2f9d53cc86f3c;p=maypole.git diff --git a/lib/Maypole/Manual/Beer.pod b/lib/Maypole/Manual/Beer.pod index 033d9ce..a1c85f2 100644 --- a/lib/Maypole/Manual/Beer.pod +++ b/lib/Maypole/Manual/Beer.pod @@ -44,9 +44,10 @@ The first Maypole application was the beer database. We've already met it; it looks like this. package BeerDB; - use base 'Apache::MVC'; + use Maypole::Application; BeerDB->set_database("dbi:SQLite:t/beerdb.db"); - BeerDB->config->{uri_base} = "http://localhost/beerdb/"; + BeerDB->config->{uri_base} = "http://localhost/beerdb"; + BeerDB->config->{template_root} = "/path/to/templates"; BeerDB->config->{rows_per_page} = 10; BeerDB->config->{display_tables} = [qw[beer brewery pub style]]; BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] ); @@ -72,7 +73,7 @@ at a time. Here's the first section: package BeerDB; - use base 'Apache::MVC'; + use Maypole::Application; BeerDB->setup("dbi:SQLite:t/beerdb.db"); This is actually all you need for a functional database front-end. Everything @@ -81,11 +82,9 @@ called C. This package is called the B, because it's a relatively small class which defines how the whole application is going to run. -The second line says that our front-end is going to be C, -which is the Apache C based version of Maypole; there's also -a CGI version, C, and a command-line version for -debugging, C, but C is usually the one you -want. +The second line says that our front-end is going to be +C, it automatically detects if you're using +mod_perl or CGI and loads everything neccessary for you. Thirdly we're going to need to set up our database with the given DBI connection string. Now the core of Maypole itself doesn't know about