[Jifty-commit] r698 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Mar 17 15:49:23 EST 2006
Author: alexmv
Date: Fri Mar 17 15:49:22 2006
New Revision: 698
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web.pm
Log:
r8608 at zoq-fot-pik: chmrr | 2006-03-17 15:49:12 -0500
* Allow Jifty->web->return( to => "..default path..", ...)
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Fri Mar 17 15:49:22 2006
@@ -843,12 +843,21 @@
I<PARAMHASH>, additionally defaults to calling the current
continuation.
+Takes an additional argument, C<to>, which can specify a default path
+to return to if there is no current continuation.
+
=cut
sub return {
my $self = shift;
+ my %args = (@_);
+ my $continuation = Jifty->web->request->continuation;
+ if (not $continuation and $args{to}) {
+ $continuation = Jifty::Continuation->new(request => Jifty::Request->new(path => $args{to}));
+ }
+ delete $args{to};
- $self->link( call => Jifty->web->request->continuation, @_ );
+ $self->link( call => $continuation, %args );
}
=head3 render_messages
More information about the Jifty-commit
mailing list