[Jifty-commit] r7509 - jifty/trunk/lib/Jifty/View/Mason
Jifty commits
jifty-commit at lists.jifty.org
Tue Oct 6 13:20:46 EDT 2009
Author: sartak
Date: Tue Oct 6 13:20:45 2009
New Revision: 7509
Modified:
jifty/trunk/lib/Jifty/View/Mason/Handler.pm
Log:
Refactor handle_comp so that we can reuse its setup
Modified: jifty/trunk/lib/Jifty/View/Mason/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Mason/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/View/Mason/Handler.pm Tue Oct 6 13:20:45 2009
@@ -207,7 +207,7 @@
shift->handle_comp(@_);
}
-sub handle_comp {
+sub _comp_setup {
my ($self, $comp, $args) = @_;
Jifty->web->session->set_cookie;
@@ -220,7 +220,14 @@
$self->interp->set_global('$jifty_internal_request', 0);
$self->interp->set_global('$jifty_internal_request', 1) if defined $args;
- my %args = $args ? %$args : $self->request_args($r);
+ return $args ? %$args : $self->request_args($r);
+}
+
+sub handle_comp {
+ my $self = shift;
+ my ($comp) = @_;
+
+ my %args = $self->_comp_setup(@_);
$self->interp->exec($comp, %args);
}
More information about the Jifty-commit
mailing list