X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=bbe490565ab149f862eefc812a6343fa06457bf7;hb=053b67100478267d34ac98094af3af742098f5fe;hp=b55f4f810ef18a0bed337f5ace24765868062914;hpb=9bbeafd23117d2b489a298cc002a97b133de17bd;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index b55f4f8..bbe4905 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -5,7 +5,7 @@ use UNIVERSAL::require; use Apache::Constants ":common"; use strict; use warnings; -our $VERSION = "0.2"; +our $VERSION = "1.0"; __PACKAGE__->mk_classdata($_) for qw( config init_done view_object ); __PACKAGE__->mk_accessors ( qw( ar params query objects model_class args action template )); @@ -135,7 +135,7 @@ this: package ProductDatabase; use base 'Maypole'; __PACKAGE__->set_database("dbi:mysql:products"); - BeerDB->config->{uri_base} = "http://your.site/catalogue/"; + ProductDatabase->config->{uri_base} = "http://your.site/catalogue/"; ProductDatabase::Product->has_a("category" => ProductDatabase::Category); # ... @@ -190,6 +190,9 @@ subclass the model class, and configure your class slightly differently: $r->template("template_name"); } +Then your top-level application package should change the model class: +(Before calling C) + ProductDatabase->config->{model_class} = "ProductDatabase::Model"; (The C<:Exported> attribute means that the method can be called via the