public function hasErrors($message = true)
    {
        if (empty($this->errors)) {
            return false;
        }

        if ($message) {
            $this->setMessage($this->text('One or more errors occurred'), 'danger');
        }

        if (isset($this->post_key)) {
            $this->setData($this->post_key, $this->submitted);
        }

        return true;
    }
public function hasErrors($message = true)
    {
        if (empty($this->errors)) {
            return false;
        }

        if ($message) {
            $this->setMessage($this->text('One or more errors occurred'), 'danger');
        }

        if (isset($this->post_key)) {
            $this->setData($this->post_key, $this->submitted);
        }

        return true;
    }
public function hasErrors ( $ message = true ) { if ( empty ( $ this -> errors ) ) { return false ; } if ( $ message ) { $ this -> setMessage ( $ this -> text ( 'One or more errors occurred' ) , 'danger' ) ; } if ( isset ( $ this -> post_key ) ) { $ this -> setData ( $ this -> post_key , $ this -> submitted ) ; } return true ; }
Returns true if an error occurred and pass back to template the submitted data
@param boolean $message
@return boolean
Returns true if an error occurred and pass back to template the submitted data