[html-formfu] labels from DBIC?

Moritz Onken onken at houseofdesign.de
Mon Jul 7 15:59:33 BST 2008


you can add a method to your dbic row class:

sub table_col {
	my $self = shift;
	return $self->table->col;
}

And use table_col in you formfu config file.

Should work, right?


Am 07.07.2008 um 16:48 schrieb Carl Franks:

> 2008/7/6 Josef Chladek <josef.chladek at gmail.com>:
>> hello list,
>>
>> is there a way to have formfu make dynamic labels, aka labels from a
>> dbic-row?
>
> okay, I've added support for this in the subversion repository.
>
> You can now add a 'label' model_config to any field or multi block,  
> like so:
>    type: Multi
>    model_config:
>      label: 'label-col'
>
> At the moment, if there's a relationship of the same name, it'll call
> $row->get_column($label) - otherwise it does $row->$label.
>
> This means it supports non-column accessors, but it also means that
> the column must be on the particular row that's being processed.
> (ie, you can't do 'table.col' to reference another table)
> Can anyone think of a sensible way to handle that?
>
> Thanks for the good idea.
>
> Cheers,
> Carl
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu




More information about the HTML-FormFu mailing list