[html-formfu] labels from DBIC?

Carl Franks fireartist at gmail.com
Mon Jul 7 15:48:02 BST 2008


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



More information about the HTML-FormFu mailing list