aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Role/Actions.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-11 23:45:47 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-10-11 23:45:47 +0000
commit3be50b19f80d78dc4889fa3cc7586febcbcdcb86 (patch)
treee63288b262bc13340c6c099c289cf02b13c01bf6 /lib/Reaction/UI/ViewPort/Role/Actions.pm
parent7ea09fbbbbed128e4f5e9dc0c0dbafe3fb644b80 (diff)
downloadreaction-3be50b19f80d78dc4889fa3cc7586febcbcdcb86.tar.gz
reaction-3be50b19f80d78dc4889fa3cc7586febcbcdcb86.zip
some more doc patches
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Role/Actions.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Role/Actions.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm
index a8e6e28..1731a7e 100644
--- a/lib/Reaction/UI/ViewPort/Role/Actions.pm
+++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm
@@ -76,8 +76,41 @@ A role to ease attaching actions to L<Reaction::InterfaceModel::Object>s
=head2 actions
+Automatically built ArrayRef of URI objects pointing to actions
+
=head2 action_prototypes
+A HashRef of prototypes for building the Action links. The prototypes should be
+composed like these:
+
+ my %action_prototypes = (
+ example_action => { label => 'Example Action', uri => $uri_obj },
+ );
+
+ #or you can get fancy and do something like what is below:
+ sub make_label{
+ my($im, $ctx) = @_; #InterfaceModel::Object/Collection, Catalyst Context
+ return 'label_text';
+ }
+ sub make_uri{
+ my($im, $ctx) = @_; #InterfaceModel::Object/Collection, Catalyst Context
+ return return $ctx->uri_for('some_action');
+ }
+ my %action_prototypes = (
+ example_action => { label => \&make_label, uri => \&make_uri },
+ );
+
+=head2 action_order
+
+User-provided ArrayRef with how the actions should be ordered eg
+
+ action_order => [qw/view edit delete/]
+
+=head2 computed_action_order
+
+The final computed action order. This may differ from the action_order provided
+if you didn't list all of the actions in that.
+
=head1 AUTHORS
See L<Reaction::Class> for authors.