/[webpac2]/Webpacus2/lib/Webpacus/View.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /Webpacus2/lib/Webpacus/View.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 954 - (hide annotations)
Thu Nov 1 00:17:53 2007 UTC (16 years, 5 months ago) by dpavlin
File size: 795 byte(s)
 r1444@llin:  dpavlin | 2007-11-01 00:23:41 +0100
 return coderef to Template::Declare to create somewhat nice calling
 syntax in form of:
 
 $row->( 'Field Name' )
 
 allowing spaces and such characters in names...

1 dpavlin 946 package Webpacus::View;
2    
3     use strict;
4     use warnings;
5    
6     use Jifty::View::Declare -base;
7    
8     use Data::Dump qw/dump/;
9    
10    
11     template '/' => page {
12     my $action = new_action( class => 'Search' );
13     h1 { _("Search out data") },
14     form {
15     render_param( $action => 'field', default_value => get('field') ),
16     render_param( $action => 'query', default_value => get('query') ),
17     form_submit(
18     label => _('Search'),
19     );
20     };
21    
22     #warn dump( $action->result->content );
23    
24     if ( my $results = $action->result->content( 'results' ) ) {
25     ul {
26     while ( my $row = $results->next ) {
27     warn "view :: row = ",dump( $row );
28     li {
29 dpavlin 954 div { $row->( 'TitleProper' ) }
30     div { $row->( 'DatePublication' ) }
31     tt { $row->( 'database' ) . '/' . $row->( 'input' ) . '/' . $row->( 'id' ) }
32 dpavlin 946 }
33     }
34     }
35     }
36    
37     };
38    
39    
40     1;

  ViewVC Help
Powered by ViewVC 1.1.26