public function getSpec(ElementInterface $element) { if ($element instanceof InputProviderInterface) { $inputFilter = new ZfInputFilter(); $inputFilter->add($element->getInputSpecification()); $inputFilterRender = new InputFilter(); $data = $inputFilterRender->render($inputFilter); return $data[$element->getName()]; } return array('filters' => array(), 'validators' => array()); }
public function renderInputFilter(FormInterface $form, ZfInputFilter $inputFilter = null) { $data = array(); $filterRender = new InputFilter(); $filterData = $filterRender->render($inputFilter); foreach ($form as $element) { $name = $element->getName(); if (array_key_exists($name, $filterData)) { $spec = $filterData[$name]; $data[$name] = $spec; } } return $data; }