我在发布表单后尝试在ZF2控制器中调用clearValidators
。但我得到了错误。
在UserController.php中调用未定义的方法Zend \ Form \ Element \ MultiCheckbox :: clearValidators()
$element =$form->get('user_tag_id');
element->clearValidators();
有什么建议吗?
答案 0 :(得分:0)
好吧,
我找到了替代方案。
I have remove the filter class and write Custom filter after form Posting. This works
#Filter Striptags
$filter = new \Zend\Filter\StripTags();
$row =$filter->filter($row);
#StringTrim
$filter = new \Zend\Filter\StringTrim();
$row =$filter->filter($row);
#StringTrim
$filter = new \Zend\Filter\HtmlEntities();
$row =$filter->filter($row);