Hello ...

I am trying to figure out how I can apply validation to a field only
when another field is set to true,

basic example:

class SomeEntity
{
  /**
   * @validation: NotBlank();
   */
  protected $foo;

  /**
   * When true we want to validate $foo
   */
  protected $enable_foo;
}

Validation Groups crossed my mind, but these apply to the entire form
and in practice this needs to work on an arbitary number of fields, so
actually what I want is something like this:

class SomeEntity
{
   /**
    * @validation: If( -- enable_foo_is_true --) { @validation:NotBlank() }
    */
   protected $foo;
}

Im guessing that that is a no, Any ideas?

-- 
Dan Leech

Web Developer
www.dantleech.com

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to