public function onerror($attributes) {

        if(false === is_array($attributes)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
        }

        if(true === isset($this -> attributes['name'])) {

            $helper = new StringToArray();
            $data   = $helper -> execute($this -> attributes['name'], null, MessageFile :: getErrors(true));
            $data   = $helper -> execute($this -> attributes['name'], null, MessageForm :: getErrors(true));

            if(null !== $data) {
                $this -> attributes = array_merge($this -> attributes, $attributes);
            }
        }

        return $this;
    }
public function onerror($attributes) {

        if(false === is_array($attributes)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($attributes)), E_USER_ERROR);
        }

        if(true === isset($this -> attributes['name'])) {

            $helper = new StringToArray();
            $data   = $helper -> execute($this -> attributes['name'], null, MessageFile :: getErrors(true));
            $data   = $helper -> execute($this -> attributes['name'], null, MessageForm :: getErrors(true));

            if(null !== $data) {
                $this -> attributes = array_merge($this -> attributes, $attributes);
            }
        }

        return $this;
    }
public function onerror ( $ attributes ) { if ( false === is_array ( $ attributes ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type array, "%s" given' , __METHOD__ , gettype ( $ attributes ) ) , E_USER_ERROR ) ; } if ( true === isset ( $ this -> attributes [ 'name' ] ) ) { $ helper = new StringToArray ( ) ; $ data = $ helper -> execute ( $ this -> attributes [ 'name' ] , null , MessageFile :: getErrors ( true ) ) ; $ data = $ helper -> execute ( $ this -> attributes [ 'name' ] , null , MessageForm :: getErrors ( true ) ) ; if ( null !== $ data ) { $ this -> attributes = array_merge ( $ this -> attributes , $ attributes ) ; } } return $ this ; }
Merges the given attributes with the already existing attributes on error
@param array $attributes
@return sFire\Form\Traits\FormTrait
Merges the given attributes with the already existing attributes on error