parseSessionMessages (function)

Last updated: Mon, Apr 17, 2023 1:21 pm
Return to Knowledgebase

Purpose

Used to retrieve and parse session messages that have been set using the setGenMsg, setValSuc, and setValErr functions

Location

users/helpers/us_helpers.php

Parameters

This function does not take any arguments

Returns

Data Type Description of Returned Data
array Returns an array of messages with keys for each message type.

Further Documentation:

Example usage:

// Set session messages
Session::setGenMsg('Welcome!');
Session::setValErr(['Username is required', 'Password is required']);

// Get and parse session messages
$messages = parseSessionMessages();
echo $messages['genMsg']; // Output: Welcome!
echo $messages['valErr']; // Output:
  • Username is required
  • Password is required