title: zendframework 2 inputfilter customize default error message
body: <p>I am trying to customize the default error message "<code>Value is required and can't be empty</code>"
  in zf2</p>
  
  <p>I am using following code to add customise default error message in validators of inputfilter</p>
  
  <pre><code>$inputFilter-&gt;add($factory-&gt;createInput(array(
                  'name' =&gt; 'username',
                  'required' =&gt; true,
                  'filters' =&gt; array(
                      array('name' =&gt; 'StripTags'),
                      array('name' =&gt; 'StringTrim'),
                  ),
                  'validators' =&gt; array(
                      array(
                          'name' =&gt; 'StringLength',
                          'options' =&gt; array(
                              'encoding' =&gt; 'UTF-8',
                              'min' =&gt; 4,
                              'max' =&gt; 20,
                              'messages' =&gt; array(
                                  'isEmpty' =&gt; 'Please enter User Name between 4 to 20 character!' 
                              ),                            
                          ),
                      ),
                  ),
              )));
  </code></pre>
  
  <p>But I am getting following error. </p>
  
  <pre><code>Zend\Validator\Exception\InvalidArgumentException
  
  File:
      /home/website/vendor/zendframework/zendframework/library/Zend/Validator/AbstractValidator.php:220
  
  Message:
      No message template exists for key 'isEmpty'
  </code></pre>
  
  <p>What I am doing wrong?</p>
  
  <p><a href="http://samsonasik.wordpress.com/2012/10/01/zend-framework-2-extending-zendform-to-add-select-multicheckbox-emaildate-textarea-and-radio-element/" rel="noreferrer">reference</a></p>