]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
making Untainting less awful
[maypole.git] / lib / Maypole.pm
index 2f609d8b0496b1838e5069b403e1f5273afcdc1b..fe2d29a0c5dad032b905a55aade0945b1faffd3d 100644 (file)
@@ -253,7 +253,7 @@ Some packages respond to higher debug levels, try increasing it to 2 or 3.
 
 =cut
 
-sub debug { 0 }      
+sub debug { 0 }
 
 =item config
 
@@ -261,20 +261,34 @@ Returns the L<Maypole::Config> object
 
 =item setup
 
-    My::App->setup($data_source, $user, $password, \%attr);
-
-Initialise the Maypole application and plugins and model classes - see
-L<Maypole::Manual::Plugins>.
-
-If your model is based on L<Maypole::Model::CDBI>, the C<\%attr> hashref can 
-contain options that are passed directly to L<Class::DBI::Loader>, to control 
-how the model hierarchy is constructed. 
+   My::App->setup($data_source, $user, $password, \%attr);
 
+Initialise the Maypole application and plugins and model classes.
 Your application should call this B<after> setting up configuration data via
 L<"config">.
 
+It calls the hook  C<setup_model> to setup the model. The %attr hash contains
+options and arguments used to set up the model. See the particular model's
+documentation. However here is the most usage of setup where
+Maypole::Model::CDBI is the base class.
+
+ My::App->setup($data_source, $user, $password,
+       {  opitons => {  # These are DB connection options
+               AutoCommit => 0,
+               RaiseError => 1,
+               ...
+          },
+          # These are Class::DBI::Loader arguments.
+          relationships  => 1,
+          ...
+       }
+ );
+
+Also, see  L<Maypole::Manual::Plugins>.
+
 =cut
 
+
 sub setup
 {
     my $class = shift;
@@ -457,8 +471,9 @@ sub handler : method  {
 }
 
 sub component {
+  my ($r,$path) = @_;
   my $component = Maypole::Components->new(@_);
-  return $component->handler;
+  return $component->handler($path);
 }