title: Empty values passed to Zend framework 2 validators
body: <p>How can I pass an empty value through Zend framework 2 ValidatorChain to my custom validator?</p>
  
  <p>It was possible on ZF1 by <code>allowEmpty(false)</code></p>
  
  <p>On ZF2 with empty element value :</p>
  
  <ul>
  <li><p>If <code>allowEmpty = false</code>, NotEmptyValidator is added to the top of ValidatorChain with <code>breakOnFailure = true</code>, <code>@see Zend/InputFilter/Input#injectNotEmptyValidator</code>.</p></li>
  <li><p>If <code>allowEmpty = true</code>, Element is considered as Valid, <code>@see Zend/InputFilter/BaseInputFilter#isValid</code>  </p>
  
  <pre><code>if ($input-&gt;allowEmpty()) {
      $this-&gt;validInputs[$name] = $input;
      continue;
  }
  </code></pre></li>
  </ul>