I am trying to write some javascript validation, using serverside. Using load_config_file and lots of small config-files, I have gotten alot closer, but I was wondering if some of this might fit better in HTML::FormFu.

I need a way to serialize the Exception-objects into hash'es suitable for passing as JSON to the client. I could just oneshot this in my code, but perhaps it should be something more "standard"?

    if (my $errors = $form->get_errors({

    })) {
        # We have errors!
        my @err;
        foreach (@$errors) {
$c->log->debug($_ . " ::: " . $_->name . " - " . $_- >message) if $c->debug;
            push(@err, {
                name => "" . $_->name,
                message => "" . $_->message
            });
        }
        $c->stash->{api_errors} = [EMAIL PROTECTED];
    }


This is what I do now, and as a first step I was wondering if the creation of a hash there could be replaced by a method-call on the objects for instance?

If I am the only one ever going to use it, theres no point of course


- andreas


_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to