X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FBeer.pod;h=f99e0a2ecd9a9baf5dbd1e946c4f7c3c14b34dfb;hb=18096e68c595d57caa38ff3f9b5bf59f874d7a22;hp=542b570caa7fbd04cd8c75b718a4fd85b51d3365;hpb=79d067d4ca9ea85dba1c0a62da0c726fcac2b5e3;p=maypole.git diff --git a/lib/Maypole/Manual/Beer.pod b/lib/Maypole/Manual/Beer.pod index 542b570..f99e0a2 100644 --- a/lib/Maypole/Manual/Beer.pod +++ b/lib/Maypole/Manual/Beer.pod @@ -185,12 +185,15 @@ The equivalent in ordinary C would be: BeerDB::Handpump->has_a(beer => "BeerDB::Beer"); BeerDB::Handpump->has_a(pub => "BeerDB::Pub"); - BeerDB::Pub->has_many(beers => [ BeerDB::Handpump => 'beer' ]); - BeerDB::Beer->has_many(pubs => [ BeerDB::Handpump => 'pub' ]); + BeerDB::Pub->has_many(beers => [ 'BeerDB::Handpump' => 'beer' ]); + BeerDB::Beer->has_many(pubs => [ 'BeerDB::Handpump' => 'pub' ]); Maypole's default templates will use this information to display, for instance, a list of a brewery's beers on the brewery view page. +Note the quoting in 'BeerDB::Handpump' => 'beer', if you forget to quote the +left side when using strict you will get compilation errors. + This is the complete beer database application; Maypole's default templates and the actions in the view class do the rest. But what if we want to do a little more. How would we begin to extend this application?