Habari\Session::messages_get PHP Метод

messages_get() публичный статический Метод

Return output of notice and error messages
public static messages_get ( boolean $clear = true, array $callback = null ) : mixed
$clear boolean true to clear the messages from the session upon receipt
$callback array a reference to a callback function for formatting the the messages or the string 'array' to get a raw array
Результат mixed output of messages
    public static function messages_get($clear = true, $callback = null)
    {
        $errors = self::get_errors($clear);
        $notices = self::get_notices($clear);
        // if callback is 'array', then just return the raw data
        if ($callback == 'array') {
            $output = array_merge($errors, $notices);
        } else {
            if (isset($callback) && is_callable($callback)) {
                $output = call_user_func($callback, $notices, $errors);
            } else {
                $output = Format::html_messages($notices, $errors);
            }
        }
        return $output;
    }