2010/3/8 Alex Povolotsky <tark...@over.ru>:
> Hello!
>
> I'm writing (yet annother) CRUD controller, and I need two very similar
> forms, for add and edit a user.
>
> On adding user, I'd like to set password field required; for editing, it's
> not, and empty password field means "password unchanged".
>
> What's the best way to implement this functionality without having two
> similar config files?

Hi,

If it's just the constaint that differs - I'd suggest defining the
form without the constraint in "user_edit.yml"

Then in "user_add.yml", just do:

    ---
    load_config_file: 'user_edit.yml'
    constraints:
      - type: Required
        name: password

Carl

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

Reply via email to