public function error($field, $all = false)
    {
        if (!empty($this->_errors[$field])) {
            return $all ? $this->_errors[$field] : reset($this->_errors[$field]);
        }
        return '';
    }
public function error($field, $all = false)
    {
        if (!empty($this->_errors[$field])) {
            return $all ? $this->_errors[$field] : reset($this->_errors[$field]);
        }
        return '';
    }
public function error ( $ field , $ all = false ) { if ( ! empty ( $ this -> _errors [ $ field ] ) ) { return $ all ? $ this -> _errors [ $ field ] : reset ( $ this -> _errors [ $ field ] ) ; } return '' ; }
Return an indivitual error

@param  string       $field The field name.
@param  string|array $all   Indicate whether all errors or simply the first one need to be returned.
@return string              Return an array of error messages or the first one (depending on `$all`) or
an empty string for no error.
Return an indivitual error