[Jifty-commit] r3974 - jifty/trunk/lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Aug 24 17:47:09 EDT 2007
Author: clkao
Date: Fri Aug 24 17:47:08 2007
New Revision: 3974
Modified:
jifty/trunk/lib/Jifty/View/Declare/Helpers.pm
jifty/trunk/lib/Jifty/View/Declare/Page.pm
Log:
In td's page { foo => 'bar', title => 'blah' } content {} style,
pass the metadata to the content code as the second argument.
Modified: jifty/trunk/lib/Jifty/View/Declare/Helpers.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Helpers.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/Helpers.pm Fri Aug 24 17:47:08 2007
@@ -328,7 +328,9 @@
# XXX: fallback, this is ugly
Jifty::Util->require( $page_class );
- my $page = $page_class->new({ content_code => shift });
+ my $content_code = shift;
+ my $meta = shift;
+ my $page = $page_class->new({ content_code => $content_code, _meta => $meta });
my ($spa) = Jifty->find_plugin('Jifty::Plugin::SinglePage');
Modified: jifty/trunk/lib/Jifty/View/Declare/Page.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Page.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/Page.pm Fri Aug 24 17:47:08 2007
@@ -17,7 +17,7 @@
use Jifty::View::Declare::Helpers;
-__PACKAGE__->mk_accessors(qw(content_code done_header _title));
+__PACKAGE__->mk_accessors(qw(content_code done_header _title _meta));
use constant allow_single_page => 1;
=head2 new
@@ -33,6 +33,9 @@
my ($title) = get_current_attr(qw(title));
$self->_title($title);
+ $self->_title($self->_meta->{title})
+ if $self->_meta && $self->_meta->{title};
+
return $self;
}
More information about the Jifty-commit
mailing list