フォームのZend 2で 'InArray'バリデーターを実装しようとしていますが、無効に戻っています。Zend 2フォームバリデータ 'InArray' - 複雑な配列が無効返される
フォーム要素のセットアップ:
$enquiryType = new Element\Select('enquiryType');
$enquiryType->setLabel('* What is your enquiry about?')
->setLabelAttributes(array('class' => 'sq-form-question-title'))
->setAttribute('class', 'sq-form-field required')
->setValueOptions($enquiryTypes);
フィルター/バリのセットアップ:ここでは、コードです
$enquiryType = new Input('enquiryType');
$enquiryType->getValidatorChain()
->addByName('InArray', array('haystack' => $enquiryTypes));
そして、ここではmodule.config経由で$ enquiryTypesに渡される配列です.phpファイル
'enquiryCategories' => array(
'empty_option' => 'Please select an option',
array(
'label' => 'General enquiries',
'options' => array(
'skype' => 'Skype with your library feedback',
'question' => 'Ask a question',
'feedback' => 'Library feedback',
'eresource' => 'Electronic resources (e.g. e-book, e-journal, database)',
'webbridge' => 'WebBridge Problems',
'dro' => 'DRO'
)
),
array(
'label' => 'Application to review',
'options' => array(
'10400' => 'I\'ve returned the item',
'10401' => 'I didn\'t know about overdue points but now I have some',
'10402' => 'Why did I get this invoice?',
'10403' => 'The item I borrowed is lost',
'10404' => 'The item I borrowed has been damaged',
'10405' => 'I never got/had the book',
'10406' => 'Other'
)
)
),
私はこれのさまざまなバリエーションを試しました(再帰的検証alそう)しかし、これを働かせることができませんでした。次のように私が試してみた
私がリンクされ、質問を見ていたが、これはあります1つの選択ドロップダウンだけ。配列内の配列は、基本的に