title: Incorporate custom validation error messages into form object by element
body: <p>I have the following code which creates a specific text element:</p>
  
  <pre><code>       $this-&gt;add([           
              'type'  =&gt; 'text',
              'name' =&gt; 'newpassword',
              'attributes' =&gt; [
                  'id' =&gt; 'newpassword',
                  'class' =&gt; 'form-control'
              ],
              'options' =&gt; [
                  'label' =&gt; 'Enter New User Password',
              ],
          ]);
  </code></pre>
  
  <p>And I have the following code which produces my input filter definitions:</p>
  
  <pre><code>            $inputFilter-&gt;add([
                      'name'     =&gt; 'newpassword',
                      'required' =&gt; true,
                      'filters'  =&gt; [
                          ['name' =&gt; 'StringTrim'],
                          ['name' =&gt; 'StripTags']                 
                      ],
                      'validators' =&gt; [
                          [
                              'name'    =&gt; 'StringLength',
                              'options' =&gt; [
                                  'min' =&gt; 6,
                                  'max' =&gt; 256
                              ],
                          ]                   
                      ],
              ]);       
  </code></pre>
  
  <p>What I want to accomplish is adding my custom messages. Here's the way they have it in the api documentation:</p>
  
  <pre><code>$validator = new Zend\Validator\StringLength(array('min' =&gt; 8, 'max' =&gt; 12));
  
  $validator-&gt;setMessages( array(
      Zend\Validator\StringLength::TOO_SHORT =&gt;
      'The string \'%value%\' is too short',
      Zend\Validator\StringLength::TOO_LONG  =&gt;
      'The string \'%value%\' is too long'
  ));
  </code></pre>
  
  <p>How do I incorporate my custom validation messages into my already programmed code?</p>
  
  <p>UPDATE:</p>
  
  <p>I think this is where i will find success, but not sure how to do it: </p>
  
  <pre><code>$inputFilter-&gt;get('newpassword')-&gt;getValidatorChain()-&gt;
  </code></pre>