From: Sebastian Riedel Date: Thu, 21 Oct 2004 13:38:01 +0000 (+0000) Subject: polished documentation X-Git-Tag: 2.10~111 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=bda79f7dd44a9469d27680c1a677f75b1aff2207;p=maypole.git polished documentation git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@251 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Manual/About.pod b/lib/Maypole/Manual/About.pod index 3600a94..57c616f 100644 --- a/lib/Maypole/Manual/About.pod +++ b/lib/Maypole/Manual/About.pod @@ -195,9 +195,10 @@ For now, simply admire its brevity, as you realise this is all the code you need to write for a simple database front-end: package BeerDB; - use base 'Apache::MVC'; + use Maypole::Application; BeerDB->setup("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/] ); @@ -235,7 +236,7 @@ will give a list of beers. There might not be any yet. There's a box that lets you add them. If you have any problems getting to this point, you might want to look -at L. +at L. Play about with the site. Add some beers. Maybe go out and buy some beers to review if you need some inspiration. Don't be ill on my carpet. 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 diff --git a/lib/Maypole/Manual/BuySpy.pod b/lib/Maypole/Manual/BuySpy.pod index ef3d872..89178d4 100644 --- a/lib/Maypole/Manual/BuySpy.pod +++ b/lib/Maypole/Manual/BuySpy.pod @@ -33,7 +33,7 @@ mysql, but ended up with something like this: This leads naturally to the following driver code: package Portal; - use base 'Apache::MVC'; + use Maypole::Application; Portal->setup("dbi:mysql:ibsportal"); use Class::DBI::Loader::Relationship; Portal->config->{loader}->relationship($_) for ( diff --git a/lib/Maypole/Manual/Flox.pod b/lib/Maypole/Manual/Flox.pod index f42bc2e..3b3fdf3 100644 --- a/lib/Maypole/Manual/Flox.pod +++ b/lib/Maypole/Manual/Flox.pod @@ -135,7 +135,7 @@ As usual, though, we'll start with a handler class which sets up the database: package Flox; - use base qw(Apache::MVC); + use Maypole::Application; Flox->setup("dbi:mysql:flox"); Flox->config->{display_tables} = [qw[user invitation connection]]; 1; diff --git a/lib/Maypole/Manual/View.pod b/lib/Maypole/Manual/View.pod index c469100..81ac57b 100644 --- a/lib/Maypole/Manual/View.pod +++ b/lib/Maypole/Manual/View.pod @@ -395,7 +395,7 @@ enough for you, then you can set your own view class while configuring your application: package BeerDB; - use base 'Apache::MVC'; + use base Maypole::Application; ... BeerDB->setup("dbi:SQLite:t/beerdb.db"); BeerDB->config->{uri_base} = "http://localhost/beerdb/";