[Jifty-commit] r7149 - jifty/trunk/lib/Jifty/Manual
Jifty commits
jifty-commit at lists.jifty.org
Mon Jun 1 19:37:38 EDT 2009
Author: c9s
Date: Mon Jun 1 19:37:38 2009
New Revision: 7149
Modified:
jifty/trunk/lib/Jifty/Manual/PageRegions.pod
Log:
provide page region example in template-declare.
Modified: jifty/trunk/lib/Jifty/Manual/PageRegions.pod
==============================================================================
--- jifty/trunk/lib/Jifty/Manual/PageRegions.pod (original)
+++ jifty/trunk/lib/Jifty/Manual/PageRegions.pod Mon Jun 1 19:37:38 2009
@@ -170,6 +170,7 @@
=head2 EXAMPLES
+
=head3 Hidden information that shows after click on a link
It's ofetn required to hide some extra information, a list of objects
@@ -233,4 +234,37 @@
Wow! Works again. Enjoy.
+=head3 Page Region in Template::Declare
+
+ use Jifty::View::Declare -base;
+ use Jifty::View::Declare::Helpers;
+
+ template '/replaced' => sub {
+ my $data = get('region_data'); # get "data to pass"
+ h1 { 'Replaced!' };
+ };
+
+ template '/' => page {
+ my $region = Jifty::Web::PageRegion->new(
+ name => "region-to-replace",
+ path => "/__jifty/empty",
+ );
+
+ div { { class is 'region-div' };
+ $region->render;
+ }:
+
+ hyperlink(
+ label => "Replace",
+ onclick => {
+ region => $region,
+ replace_with => '/replaced',
+ arguments => {
+ region_data => "data to pass"
+ }
+ }
+ );
+ };
+
+
=cut
More information about the Jifty-commit
mailing list