X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FModel.pod;h=98f54cd093c495b800a66459a5d676c139d21b5c;hb=fadcae3ffddebaa38da172f9624cc60176d80b33;hp=9add8934c6f6f6e9b42ee7e3ac83f6908bc80673;hpb=628ecd5d9d294e601c79c7509140d02dcd7a1d40;p=maypole.git diff --git a/lib/Maypole/Manual/Model.pod b/lib/Maypole/Manual/Model.pod index 9add893..98f54cd 100644 --- a/lib/Maypole/Manual/Model.pod +++ b/lib/Maypole/Manual/Model.pod @@ -1,4 +1,8 @@ -=head1 Maypole Model Classes +=head1 NAME + +Maypole::Manual::Model - Maypole Model Classes + +=head1 DESCRIPTION Maypole's model classes provide an interface to your data store. In principle Maypole can connect to pretty much any data source, @@ -37,8 +41,8 @@ make writing Maypole applications a lot easier: package Maypole::Model::CDBI; use base qw(Maypole::Model::Base Class::DBI); - use Class::DBI::AsForm; - use Class::DBI::FromCGI; + use Maypole::Model::CDBI::AsForm; + use Class::DBI::FromCGI; # probabyly broken . use Class::DBI::Loader; use Class::DBI::AbstractSearch; use Class::DBI::Plugin::RetrieveAll; @@ -52,6 +56,29 @@ The second reason why we want our table classes to inherit from C is because it provides a useful set of default actions. So what's an action, and why are they useful? + +=head2 Maypole::Model::CDBI::Plain + +The 'Plain' maypole Model : C allows you + + package Foo; + use 'Maypole::Application'; + + Foo->config->model("Maypole::Model::CDBI::Plain"); + Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]); + + # untaint columns and provide custom actions for each class + + Foo::SomeTable->untaint_columns(email => ['email'], printable => [qw/name description/]); + + Foo::Other::Table->untaint_columns ( ... ); + + sub Foo::SomeTable::SomeAction : Exported { + + . . . + + } + =head2 Extending a model class with actions Maypole operates primarily by turning URLs into method calls on a model @@ -109,12 +136,10 @@ We'll look more at how to put together actions in the L chapter and our case studies. -=head2 What Maypole wants from a model - -=head2 Building your own model class - =head2 Links L, Next L, Previous L + +=cut