protected function addCheckFields()
    {
        $check = 1;
        foreach ($this->checkFields as $label => &$value) {
            if ($value instanceof \Zend_Form_Element) {
                $element = $value;
            } else {
                if ($value) {
                    $element = new \Zend_Form_Element_Text('check_' . $check);
                    $element->setAllowEmpty(false);
                    $element->setLabel($label);

                    $validator = new \Zend_Validate_Identical($value);
                    $validator->setMessage(
                            sprintf($this->_('%s is not correct.'), $label),
                            \Zend_Validate_Identical::NOT_SAME
                            );
                    $element->addValidator($validator);

                    $value = $element;
                    $check++;
                } else {
                    // Nothing to check for
                    unset($this->checkFields[$label]);
                    continue;
                }
            }
            $this->addElement($element);
        }
    }
protected function addCheckFields()
    {
        $check = 1;
        foreach ($this->checkFields as $label => &$value) {
            if ($value instanceof \Zend_Form_Element) {
                $element = $value;
            } else {
                if ($value) {
                    $element = new \Zend_Form_Element_Text('check_' . $check);
                    $element->setAllowEmpty(false);
                    $element->setLabel($label);

                    $validator = new \Zend_Validate_Identical($value);
                    $validator->setMessage(
                            sprintf($this->_('%s is not correct.'), $label),
                            \Zend_Validate_Identical::NOT_SAME
                            );
                    $element->addValidator($validator);

                    $value = $element;
                    $check++;
                } else {
                    // Nothing to check for
                    unset($this->checkFields[$label]);
                    continue;
                }
            }
            $this->addElement($element);
        }
    }
protected function addCheckFields ( ) { $ check = 1 ; foreach ( $ this -> checkFields as $ label => & $ value ) { if ( $ value instanceof \ Zend_Form_Element ) { $ element = $ value ; } else { if ( $ value ) { $ element = new \ Zend_Form_Element_Text ( 'check_' . $ check ) ; $ element -> setAllowEmpty ( false ) ; $ element -> setLabel ( $ label ) ; $ validator = new \ Zend_Validate_Identical ( $ value ) ; $ validator -> setMessage ( sprintf ( $ this -> _ ( '%s is not correct.' ) , $ label ) , \ Zend_Validate_Identical :: NOT_SAME ) ; $ element -> addValidator ( $ validator ) ; $ value = $ element ; $ check ++ ; } else { // Nothing to check for unset ( $ this -> checkFields [ $ label ] ) ; continue ; } } $ this -> addElement ( $ element ) ; } }
Add user defined checkfields

@return void
Add user defined checkfields