hMessages.php

The hMessages.php helper offers a suite of functions to manage ephemeral (flash) messages in Osclass. These functions enable you to add various types of messages — such as error, success (ok), informational, and warning — to the session. You can then retrieve and display these messages, ensuring that users receive immediate feedback on their actions.

Functions Description

osc_add_flash_message($msg, $section = 'pubMessages') – Adds an ephemeral message to the session (error style).

osc_add_flash_ok_message($msg, $section = 'pubMessages') – Adds an ephemeral message to the session (ok style).

osc_add_flash_error_message($msg, $section = 'pubMessages') – Adds an ephemeral message to the session (error style).

osc_add_flash_info_message($msg, $section = 'pubMessages') – Adds an ephemeral message to the session (info style).

osc_add_flash_warning_message($msg, $section = 'pubMessages') – Adds an ephemeral message to the session (warning style).

osc_show_flash_message($section = 'pubMessages', $class = 'FlashMessage', $id = 'FlashMessage') – Shows all pending flash messages from the session and then cleans up the flash messages array.

osc_get_flash_message($section = 'pubMessages') – Retrieves flash messages from the session.