I get it.
validators are multidimensional arrays, and each array has a name and some parameters. It may be a bit related at the beginning to notice this, but the big configuration in zf2 is this way
see example for password:
$inputFilter->add($factory->createInput([ 'name' => 'password', 'required' => true, 'filters' => [ ['name' => 'StringTrim'], ], 'validators' => [ [ 'name' => 'StringLength', 'options' => [ 'encoding' => 'UTF-8', 'min' => 6, 'max' => 128, ], ], ], ])); $inputFilter->add($factory->createInput([ 'name' => 'password_verify', 'required' => true, 'filters' => [ ['name' => 'StringTrim'], ], 'validators' => [ array( 'name' => 'StringLength', 'options' => array( 'min' => 6 ), ), array( 'name' => 'identical', 'options' => array('token' => 'password' ) ), ], ]));
Note that in php 5.3> an array can be written as array() or [] , in the above example I mix them for no particular reason.
source share