]> git.decadent.org.uk Git - maypole.git/blob - ex/fancy_example/BeerDB/Base.pm
Beginning to a fancy example app of 2.11 features . See
[maypole.git] / ex / fancy_example / BeerDB / Base.pm
1 package BeerDB::Base;
2 use base qw/Maypole::Model::CDBI/;
3 use strict;
4 use warnings;
5
6 # Overide list to add display_columns to cgi  
7 # Perhaps do this in AsForm?
8
9 sub list : Exported {
10         use Data::Dumper;
11         my ($self, $r) = @_;
12         $self->SUPER::list($r);
13         my %cols =  map { $_ => 1 } $self->columns, $self->display_columns;
14         my @cols = keys %cols;
15         $r->template_args->{classmetadata}{cgi} = { $self->to_cgi(@cols) }; 
16 }
17
18 1;