Turn a long create/edit form into a guided, step-by-step wizard over the exact same single save.
form_wizard() - declare one step per call
->form_wizard($fields, $label, $options = []) declares one step; call it once per step, in the order the steps should appear. A wizard is purely a client-side presentation layer over the same single save every other form uses - the Save button only appears on the final step. It is mutually exclusive with ->fields()/->fields_arrange() as the top-level form layout.
$xcrud->form_wizard('firstName,lastName,email', 'Contact Info');
$xcrud->form_wizard('addressLine1,city,postalCode', 'Address', ['desc' => 'Where should we ship?']);
$xcrud->form_wizard('cardNumber,expiry', 'Payment');
Parameter
Type
Default
Description
$fields
string|array
-
Comma-separated string or array of field names for this step; a field may appear in exactly one step
$label
string
-
Step name shown in the progress indicator
$options
array
[]
desc, next, previous - see below
Option key
Type
Description
desc
string
A short sentence shown under the step name
next
string
Next-button label just for this step, overriding the global next_label
previous
string
Previous-button label just for this step, overriding the global previous_label
form_wizard_settings() - global appearance
->form_wizard_settings($settings) configures the wizard's overall look and behavior. Call it once, anywhere after the form_wizard() declarations. Any key you omit keeps its default.