title: Zend Framework 3 filter / validate array of contents
body: <p>I've searched internet and there is no official documentation for applying input filters to arrays in ZF3.</p>
  
  <p>I have seen answers for ZF2, <a href="https://stackoverflow.com/questions/18293870/zend-framework-2-filter-validate-array-of-contents">Zend Framework 2 filter / validate array of contents</a></p>
  
  <p>Can anyone help out how to apply input filters to array of input.</p>
  
  <p>This is my form class</p>
  
  <pre><code>class ContactForm extends Form
  {
   public function __construct($name = null)
  {
      // we want to ignore the name passed
      parent::__construct("contactForm");
      $this-&gt;addInputFilters();
  }
  
  public function init()
  {
      $this-&gt;add([
          "name"                       =&gt; "Type[]",
          "type"                       =&gt; "text",
          "attributes"                 =&gt; [
              "class"                  =&gt; "form-control",
          ],
      ]);
  }
  private function addInputFilters() {
      $inputFilter-&gt;add([
          "name"                       =&gt; "Type[]",
          "required"                   =&gt; true,
          "filters"                    =&gt; [],
          "validators"                 =&gt; [
              [
                  "name"               =&gt; "StringLength",
                  "options"            =&gt; [
                      "min"            =&gt; 3,
                      "max"            =&gt; 100,
                  ],
              ],
          ],
      ]);
  }
  </code></pre>