X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FModel.pod;h=98f54cd093c495b800a66459a5d676c139d21b5c;hb=fe502daa5fcf39d01c38823dbf169199d1a50e99;hp=5f310fe7f091a7c290b01aef776b55dbe525ad4b;hpb=45e4b287c0925cab5cc2692093034275dd0d17b9;p=maypole.git diff --git a/lib/Maypole/Manual/Model.pod b/lib/Maypole/Manual/Model.pod index 5f310fe..98f54cd 100644 --- a/lib/Maypole/Manual/Model.pod +++ b/lib/Maypole/Manual/Model.pod @@ -41,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; @@ -56,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 @@ -113,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