zend 2 form filters not working -


i'm trying use zend\filter forms ensure data correctly formatted. have typical input (text) named 'parent_id' apply filters :

'filters' => array(     array('name' => 'zend\filter\int'),     array('name' => 'zend\filter\null', 'options' => array('type' => \zend\filter\null::type_integer)), ), 

after that, use custom validator on field needs check 'parent_id' value via $context.

public function isvalid($value, $context = null) {         var_dump($context); } 

when dump var $context, this:

array(2) {     ["parent_id"]=> string(0) ""     ["target_id"]=> string(1) "1" } 

i checked execution order , filters running before validator, why don't : ["parent_id"]=> null or ["parent_id"]=> int(something) ?

thank !


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -