Disable notInArray Validator Zend Framework 2

后端 未结 5 2364
醉梦人生
醉梦人生 2021-02-20 12:36

Is there a way to disable notInArray Validator in Zend Framework 2. All the info on the internet shows how to disable the notInArray Validator in Zend Framework 1, for example i

5条回答
  •  广开言路
    2021-02-20 12:58

    I found this at this link and thought I would post it as I found it a great solution .... http://samsonasik.wordpress.com/2012/10/01/zend-framework-2-extending-zendform-to-add-select-multicheckbox-emaildate-textarea-and-radio-element/

    don’t try to deactive the default validator. re-values the select options values before setData.

    $form->get('state_id')
         ->setOptions(
               array('value_options'=> $Newstatecollection)) ;
    

    Saves the mess of deactivating the function if you need it elsewhere

提交回复
热议问题