usSuccess (function)

Last updated: Fri, May 26, 2023 10:45 am
Return to Knowledgebase

Purpose

The usSuccess function in UserSpice is used to display a success message to the user by storing it in the session.

Location

users/helpers/us_helpers.php

Parameters

# Parameter Data Type Required Description
1 $msg string Yes The success message to be displayed.

Further Documentation:

// Set a success message
$message = "Your changes have been saved successfully.";

usSuccess($message);


In the example above, the usSuccess function is used to set a success message to be displayed to the user. The success message is stored in the $message variable and is passed as an argument to the usSuccess function. The function internally calls sessionValMessages to store the success message in the session, which can then be retrieved and displayed to the user.

Note: You would typically use this function in conjunction with other functions or code that handles displaying session messages to the user.