public function fullMessages($errors=null) 
    {
        if (!function_exists("yaml_parse") 
            || is_null(self::$yaml_file) 
            || !file_exists(self::$yaml_file)
        ) {
            return array();
        }

        $rtn    = array();
        $parsed = yaml_parse(file_get_contents(self::$yaml_file));
        $errors = is_null($errors) ? $this->errors : $errors;
        $locale = function_exists("locale_get_default") ? locale_get_default() : "en-US";

        if (!array_key_exists($locale, $parsed)
            || !array_key_exists("errors",   $parsed[$locale]) 
            || !array_key_exists("messages", $parsed[$locale]["errors"])
        ) {
            return $this->errorMessages();
        }

        $msgs = $parsed[$locale]["errors"]["messages"];
        $cls  = strtolower(get_called_class());

        foreach ($errors as $key => $values) {
            $attr = array_key_exists("attributes", $parsed[$locale])        &&
                array_key_exists($cls, $parsed[$locale]["attributes"])      &&
                array_key_exists($key, $parsed[$locale]["attributes"][$cls]) ?
                $parsed[$locale]["attributes"][$cls][$key] : $key;

            foreach ($values as $value) {
                $msg = array_key_exists($value, $msgs) ? $msgs[$value] : ":$value";
                array_push($rtn, "$attr $msg");
            }
        }
        return $rtn;
    }
public function fullMessages($errors=null) 
    {
        if (!function_exists("yaml_parse") 
            || is_null(self::$yaml_file) 
            || !file_exists(self::$yaml_file)
        ) {
            return array();
        }

        $rtn    = array();
        $parsed = yaml_parse(file_get_contents(self::$yaml_file));
        $errors = is_null($errors) ? $this->errors : $errors;
        $locale = function_exists("locale_get_default") ? locale_get_default() : "en-US";

        if (!array_key_exists($locale, $parsed)
            || !array_key_exists("errors",   $parsed[$locale]) 
            || !array_key_exists("messages", $parsed[$locale]["errors"])
        ) {
            return $this->errorMessages();
        }

        $msgs = $parsed[$locale]["errors"]["messages"];
        $cls  = strtolower(get_called_class());

        foreach ($errors as $key => $values) {
            $attr = array_key_exists("attributes", $parsed[$locale])        &&
                array_key_exists($cls, $parsed[$locale]["attributes"])      &&
                array_key_exists($key, $parsed[$locale]["attributes"][$cls]) ?
                $parsed[$locale]["attributes"][$cls][$key] : $key;

            foreach ($values as $value) {
                $msg = array_key_exists($value, $msgs) ? $msgs[$value] : ":$value";
                array_push($rtn, "$attr $msg");
            }
        }
        return $rtn;
    }
public function fullMessages ( $ errors = null ) { if ( ! function_exists ( "yaml_parse" ) || is_null ( self :: $ yaml_file ) || ! file_exists ( self :: $ yaml_file ) ) { return array ( ) ; } $ rtn = array ( ) ; $ parsed = yaml_parse ( file_get_contents ( self :: $ yaml_file ) ) ; $ errors = is_null ( $ errors ) ? $ this -> errors : $ errors ; $ locale = function_exists ( "locale_get_default" ) ? locale_get_default ( ) : "en-US" ; if ( ! array_key_exists ( $ locale , $ parsed ) || ! array_key_exists ( "errors" , $ parsed [ $ locale ] ) || ! array_key_exists ( "messages" , $ parsed [ $ locale ] [ "errors" ] ) ) { return $ this -> errorMessages ( ) ; } $ msgs = $ parsed [ $ locale ] [ "errors" ] [ "messages" ] ; $ cls = strtolower ( get_called_class ( ) ) ; foreach ( $ errors as $ key => $ values ) { $ attr = array_key_exists ( "attributes" , $ parsed [ $ locale ] ) && array_key_exists ( $ cls , $ parsed [ $ locale ] [ "attributes" ] ) && array_key_exists ( $ key , $ parsed [ $ locale ] [ "attributes" ] [ $ cls ] ) ? $ parsed [ $ locale ] [ "attributes" ] [ $ cls ] [ $ key ] : $ key ; foreach ( $ values as $ value ) { $ msg = array_key_exists ( $ value , $ msgs ) ? $ msgs [ $ value ] : ":$value" ; array_push ( $ rtn , "$attr $msg" ) ; } } return $ rtn ; }
Return textual and translated error messages

@param mixed $errors found

@return mixed error messages
Return textual and translated error messages