package Maypole;
+use Class::C3;
use base qw(Class::Accessor::Fast Class::Data::Inheritable);
use UNIVERSAL::require;
use strict;
use NEXT;
use File::MMagic::XS qw(:compat);
-our $VERSION = '2.11_pre5';
+our $VERSION = '2.12';
our $mmagic = File::MMagic::XS->new();
# proposed privacy conventions:
# choose a frontend, initialise the config object, and load a plugin
use Maypole::Application qw/Relationship/;
+
+ # set everything up
+ __PACKAGE__->setup("dbi:SQLite:t/beerdb.db");
# get the empty config object created by Maypole::Application
my $config = __PACKAGE__->config;
date => [ qw/date/],
);
- # set everything up
- __PACKAGE__->setup("dbi:SQLite:t/beerdb.db");
+ # note : set up model before calling this method
+ BeerDB::Beer->required_columns([qw/name/]);
1;
# among other things, this populates $config->classes
$config->model->setup_database($config, $class, @_);
- foreach my $subclass ( @{ $config->classes } ) {
- next if $subclass->isa("Maypole::Model::Base");
- no strict 'refs';
- unshift @{ $subclass . "::ISA" }, $config->model;
- }
+ $config->model->add_model_superclass($config);
# Load custom model code, if it exists - nb this must happen after the
- # unshift, to allow code attributes to work, but before adopt(),
+ # adding the model superclass, to allow code attributes to work, but before adopt(),
# in case adopt() calls overridden methods on $subclass
foreach my $subclass ( @{ $config->classes } ) {
$class->load_model_subclass($subclass) unless ($class->model_classes_loaded());
Get/set a hash of template variables.
+Maypole reserved words for template variables will over-ride values in template_variables.
+
+Reserved words are : r, request, object, objects, base, config and errors, as well as the
+current class or object name.
+
=item stash
A place to put custom application data. Not used by Maypole itself.