Form.php
public function addConstraint($name, $closure = null)
    {
        if ($name instanceof \Closure) {
            $closure = $name;
            $name = null;
        }

        if ($name == null) {
            $this->constraints[] = $closure;
        } else {
            $this->getField($name)->addConstraint($closure);
        }
    }
public function addConstraint($name, $closure = null)
    {
        if ($name instanceof \Closure) {
            $closure = $name;
            $name = null;
        }

        if ($name == null) {
            $this->constraints[] = $closure;
        } else {
            $this->getField($name)->addConstraint($closure);
        }
    }
public function addConstraint ( $ name , $ closure = null ) { if ( $ name instanceof \ Closure ) { $ closure = $ name ; $ name = null ; } if ( $ name == null ) { $ this -> constraints [ ] = $ closure ; } else { $ this -> getField ( $ name ) -> addConstraint ( $ closure ) ; } }
Add a constraint on a field
Add a constraint on a field