protected function addErrorClass(&$options)
    {
        $errors = $this->formHelper->getRequest()->getSession()->get('errors');

        if ($errors && $errors->has($this->getNameKey())) {
            $errorClass = $this->formHelper->getConfig('defaults.wrapper_error_class');

            if ($options['wrapper'] && !str_contains($options['wrapper']['class'], $errorClass)) {
                $options['wrapper']['class'] .= ' '.$errorClass;
            }
        }

        return $options;
    }
protected function addErrorClass(&$options)
    {
        $errors = $this->formHelper->getRequest()->getSession()->get('errors');

        if ($errors && $errors->has($this->getNameKey())) {
            $errorClass = $this->formHelper->getConfig('defaults.wrapper_error_class');

            if ($options['wrapper'] && !str_contains($options['wrapper']['class'], $errorClass)) {
                $options['wrapper']['class'] .= ' '.$errorClass;
            }
        }

        return $options;
    }
protected function addErrorClass ( & $ options ) { $ errors = $ this -> formHelper -> getRequest ( ) -> getSession ( ) -> get ( 'errors' ) ; if ( $ errors && $ errors -> has ( $ this -> getNameKey ( ) ) ) { $ errorClass = $ this -> formHelper -> getConfig ( 'defaults.wrapper_error_class' ) ; if ( $ options [ 'wrapper' ] && ! str_contains ( $ options [ 'wrapper' ] [ 'class' ] , $ errorClass ) ) { $ options [ 'wrapper' ] [ 'class' ] .= ' ' . $ errorClass ; } } return $ options ; }
Add error class to wrapper if validation errors exist

@param $options
Add error class to wrapper if validation errors exist