[Jifty-commit] r2809 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Feb 21 07:37:43 EST 2007
Author: sterling
Date: Wed Feb 21 07:37:41 2007
New Revision: 2809
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/API.pm
jifty/trunk/lib/Jifty/Action.pm
jifty/trunk/lib/Jifty/Web.pm
Log:
Updated the documentation a bit more.
Modified: jifty/trunk/lib/Jifty/API.pm
==============================================================================
--- jifty/trunk/lib/Jifty/API.pm (original)
+++ jifty/trunk/lib/Jifty/API.pm Wed Feb 21 07:37:41 2007
@@ -10,17 +10,8 @@
=head1 SYNOPSIS
- # A nice way to run actions in your application
+ # Find the full name of an action
my $class = Jifty->api->qualify('SomeAction');
- $class->require;
- $action = $class->new(
- moniker => 'my_action',
- argument => {
- foo => 1,
- bar => 'baz',
- },
- );
- $action->run;
# Logged users with an ID greater than 10 have restrictions
if (Jifty->web->current_user->id > 10) {
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Wed Feb 21 07:37:41 2007
@@ -51,18 +51,20 @@
=head1 COMMON METHODS
-These common methods are designed to
+These common methods provide the basic guts for the action.
=head2 new
-Construct a new action. Subclasses who need do custom initialization
-should start with:
+B<Do not call this directly>; always go through C<< Jifty->web->new_action >>!
- my $class = shift; my $self = $class->SUPER::new(@_)
+This method constructs a new action. Subclasses who need do custom initialization should start with:
-B<Do not call this yourself>; always go through C<<
-Jifty->web->new_action >>! The arguments that this will be
-called with include:
+ my $class = shift;
+ my $self = $class->SUPER::new(@_)
+
+The arguments that this will be called with include:
+
+=head3 Arguments
=over
@@ -1112,4 +1114,15 @@
sub autogenerated {0}
+=head1 SEE ALSO
+
+L<Jifty>, L<Jifty::API>, L<Jifty::Action::Record>, L<Jifty::Result>, L<Jifty::Param::Schema>, L<Jifty::Manual::Actions>
+
+=head1 LICENSE
+
+Jifty is Copyright 2005-2006 Best Practical Solutions, LLC.
+Jifty is distributed under the same terms as Perl itself.
+
+=cut
+
1;
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Wed Feb 21 07:37:41 2007
@@ -401,25 +401,39 @@
=head3 new_action class => CLASS, moniker => MONIKER, order => ORDER, arguments => PARAMHASH
-Creates a new action (an instance of a subclass of L<Jifty::Action>)
+Creates a new action (an instance of a subclass of L<Jifty::Action>). The named arguments passed to this method are passed on to the C<new> method of the action named in C<CLASS>.
+
+=head3 Arguments
+
+=over
+
+=item class
C<CLASS> is L<qualified|Jifty::API/qualify>, and an instance of that
class is created, passing the C<Jifty::Web> object, the C<MONIKER>,
and any other arguments that C<new_action> was supplied.
+=item moniker
+
C<MONIKER> is a unique designator of an action on a page. The moniker
is content-free and non-fattening, and may be auto-generated. It is
used to tie together arguments that relate to the same action.
+=item order
+
C<ORDER> defines the order in which the action is run, with lower
numerical values running first.
+=item arguments
+
C<ARGUMENTS> are passed to the L<Jifty::Action/new> method. In
addition, if the current request (C<< $self->request >>) contains an
action with a matching moniker, any arguments that are in that
requested action but not in the C<PARAMHASH> list are set. This
implements "sticky fields".
+=back
+
As a contrast to L<Jifty::Web::Form/add_action>, this does not add the
action to the current form -- instead, the first form field to be
rendered will automatically register the action in the current form
More information about the Jifty-commit
mailing list