ClassesBigCommerceFormsSuccess Handler

Success_Handler

Handles the success of form submissions by storing a success message, form submission data, and optionally redirecting the user to a specified URL or reloading the current page.

  • Full name: \BigCommerce\Forms\Success_Handler

Constants

ConstantVisibilityTypeValue
PARAMpublicstring’bc-message’

Methods

form_success

Handles the success of a form submission.

public form_success(string $message = '', array $submission = [], string $redirect = '', array $data = []): void

This method stores the success message, form submission data, and optional extra data as a transient, and redirects the user to the provided URL (or reloads the current page if no URL is specified). The transient stores the data temporarily and can be used to display a success message after the redirect.

Parameters:

ParameterTypeDescription
$messagestringThe success message to display to the user after redirect.
$submissionarrayThe data submitted with the form.
$redirectstringThe URL to redirect to. Leave empty to reload the current URL.
$dataarrayOptional data to store with the message (e.g., additional context or metadata).


Automatically generated on 2025-01-21