public static function errorMessage(array $error) {
        if (isset($error['message'])) {
            return $error['message'];
        } else {
            $field = val('field', $error, '*');
            if (is_array($field)) {
                $field = implode(', ', $field);
            }
            return sprintft($error['code'].': %s.', $field);
        }
    }
public static function errorMessage(array $error) {
        if (isset($error['message'])) {
            return $error['message'];
        } else {
            $field = val('field', $error, '*');
            if (is_array($field)) {
                $field = implode(', ', $field);
            }
            return sprintft($error['code'].': %s.', $field);
        }
    }
public static function errorMessage ( array $ error ) { if ( isset ( $ error [ 'message' ] ) ) { return $ error [ 'message' ] ; } else { $ field = val ( 'field' , $ error , '*' ) ; if ( is_array ( $ field ) ) { $ field = implode ( ', ' , $ field ) ; } return sprintft ( $ error [ 'code' ] . ': %s.' , $ field ) ; } }
Gets the error message from an error.

Errors are stored with either a message or a translation code.
This method will look at both to determine the full message.

@param array $error The error array.
@return string Returns the message from the error.
Gets the error message from an error .