aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Role
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Role')
-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.