[html-formfu] Patch to allow to provide a callback to "when" inside a Constraint

Carl Franks fireartist at gmail.com
Fri May 30 16:17:22 BST 2008


2008/5/27 Andreas Marienborg <omega at palle.net>:
> Could you make it so a callback also could be specified via the
> config-files? Since now it seems to expect a coderef, but perhaps a string
> pointing at a sub could also be allowed, or a class-name which should
> implement some method?

    $callback->( $params )

It will actually work if $callback is a fully-qualified subroutine
name - see t/constraints/callback.t for an example.

    constraint:
      - type: Callback
        callback: "main::callback"

Carl



More information about the HTML-FormFu mailing list