public function first($key)
    {
        if ($this->has($key)) {
            $err = $this->_errors[$key];
            if (is_array($err)) {
                for ($i = 0; $i < count($err); $i++) {
                    if (!empty($err[$i])) {
                        return $err[$i];
                    }
                }
            } else {
                return $err;
            }
        }

        return ''; // return empty string since no key found to prevent errors
    }
public function first($key)
    {
        if ($this->has($key)) {
            $err = $this->_errors[$key];
            if (is_array($err)) {
                for ($i = 0; $i < count($err); $i++) {
                    if (!empty($err[$i])) {
                        return $err[$i];
                    }
                }
            } else {
                return $err;
            }
        }

        return ''; // return empty string since no key found to prevent errors
    }
public function first ( $ key ) { if ( $ this -> has ( $ key ) ) { $ err = $ this -> _errors [ $ key ] ; if ( is_array ( $ err ) ) { for ( $ i = 0 ; $ i < count ( $ err ) ; $ i ++ ) { if ( ! empty ( $ err [ $ i ] ) ) { return $ err [ $ i ] ; } } } else { return $ err ; } } return '' ; // return empty string since no key found to prevent errors }
Gets the first message for a specific error.

@param string $key - The error we're looking for

@return string - The error message
Gets the first message for a specific error .