More template pod
Tomas Doran (t0m) [Mon, 25 May 2009 18:08:24 +0000 (19:08 +0100)]
lib/CatalystX/DynamicComponent/ModelToControllerReflector.pm
lib/CatalystX/DynamicComponent/ModelsFromConfig/InterfaceRoles.pm

index f677e2c..64da97f 100644 (file)
@@ -74,3 +74,32 @@ sub generate_reflected_controller_action_method {
 
 1;
 
+__END__
+
+=head1 NAME
+
+CatalystX::DynamicComponent::ModelToControllerReflector - Generate Catalyst controllers automaticall from models and configuration.
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=head1 LINKS
+
+L<Catalyst>, L<MooseX::MethodAttributes>, L<CatalystX::ModelsFromConfig>.
+
+=head1 BUGS
+
+Probably plenty, test suite certainly isn't comprehensive.. Patches welcome.
+
+=head1 AUTHOR
+
+Tomas Doran (t0m) <bobtfish@bobtfish.net>
+
+=head1 LICENSE
+
+This code is copyright (c) 2009 Tomas Doran. This code is licensed on the same terms as perl
+itself.
+
+=cut
+
index 3db3d44..48e329d 100644 (file)
@@ -38,3 +38,55 @@ around '_setup_dynamic_model' => sub {
 
 1;
 
+__END__
+
+=head1 NAME
+
+CatalystX::DynamicComponent::ModelsFromConfig::InterfaceRoles - Generate simple L<Catalyst::Model::Adaptor> like models from application config, enforcing roles on the model classes.
+
+=head1 SYNOPSIS
+
+    package MyApp;
+    use Moose;
+    use namespace::autoclean;
+    use Catalyst qw/
+        +CatalystX::DynamicComponent::ModelsFromConfig::InterfaceRoles
+    /;
+    __PACKAGE__->config(
+        name => __PACKAGE__,
+        'CatalystX::DynamicComponent::ModelsFromConfig' => {
+            include => 'One^',
+        },
+        'Model::One' => {
+            class => 'SomeClass', # Name of class to load and construct
+            other => 'config',    # Constructor passed other parameters
+            interface_roles => [qw/ My::Role /], # Your app explodes if SomeClass doesn't do My::Role
+        },
+        ...
+    );
+    __PACKAGE__->setup;
+
+
+=head1 DESCRIPTION
+
+FIXME
+
+=head1 LINKS
+
+L<CatalystX::DynamicComponent::ModelsFromConfig>, L<CatalystX::DynamicComponent>, L<Catalyst>.
+
+=head1 BUGS
+
+Probably plenty, test suite certainly isn't comprehensive.. Patches welcome.
+
+=head1 AUTHOR
+
+Tomas Doran (t0m) <bobtfish@bobtfish.net>
+
+=head1 LICENSE
+
+This code is copyright (c) 2009 Tomas Doran. This code is licensed on the same terms as perl
+itself.
+
+=cut
+