[html-formfu] How to best pass the resultset object to DBIC validator callbacks?

Moritz Onken onken at houseofdesign.de
Thu Mar 5 21:19:27 GMT 2009


>
>
> sub index :Path :Args(0) :FormConfig {
>    my ( $self, $c ) = @_;
>    my $form = $c->stash->{form};
>
>    my $field = $form->get_all_element({name => 'url'});
>    $field->validator('Callback')->callback(sub{
>        my $value = shift;
>        return $c->model('DBIC::Urls')->validator_unique_url($value);
>    });

Hi,

I don't feel like this is the best approach.
I have a feeling that this might lead to memory leaks (does it, Carl?).

moritz



More information about the HTML-FormFu mailing list