[Jifty-commit] r3461 - jifty/trunk/lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Jun 12 15:54:45 EDT 2007
Author: clkao
Date: Tue Jun 12 15:54:44 2007
New Revision: 3461
Modified:
jifty/trunk/lib/Jifty/View/Declare/BaseClass.pm
Log:
Make use_mason_wrapper actually work.
Modified: jifty/trunk/lib/Jifty/View/Declare/BaseClass.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/BaseClass.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/BaseClass.pm Tue Jun 12 15:54:44 2007
@@ -16,22 +16,24 @@
sub use_mason_wrapper {
my $class = shift;
no strict 'refs';
+ no warnings 'redefine';
*{ $class . '::wrapper' } = sub ($) {
my $code = shift;
- no warnings 'redefine';
+
# so in td handler, we made jifty::web->out appends to td
- # buffer, we need it back for here, because $code is actually
- # called. someday we need to finish fixing the output system
- # that is in Jifty::View.
- my $td_out = \&Jifty::Web::out;
+ # buffer, we need it back for here someday we need to finish
+ # fixing the output system that is in Jifty::View.
local *Jifty::Web::out = sub { shift->mason->out(@_) };
- Jifty->handler->fallback_view_handler->interp->autoflush(1);
- local *HTML::Mason::Request::content
- = sub { local *Jifty::Web::out = $td_out; $code; '' };
- Jifty->web->request->arguments->{title} = 'YADA!';
+ local *HTML::Mason::Request::content = sub {
+ $code->();
+ my $content = Template::Declare->buffer->data;
+ Template::Declare->buffer->clear;
+ $content;
+ };
+
Jifty->handler->fallback_view_handler->show('/_elements/wrapper');
- }
+ }
}
=cut
More information about the Jifty-commit
mailing list