SilverStripe\MultiForm\Tests\Stubs\MultiFormTestStepOne
Synopsis
class MultiFormTestStepOne
extends MultiFormStep
implements
TestOnly
{
- // members
- private static $next_steps = MultiFormTestStepTwo::class;
- // Inherited members from MultiFormStep
- protected $title;
- protected MultiForm $form;
- protected array $extraClasses;
- protected array $step_data_cache;
- // methods
- public void getFields()
- // Inherited methods from MultiFormStep
- public FieldList getFields()
- public FieldList getExtraActions()
- public bool|Validator getValidator()
- public string getTitle()
- public string Link()
- public array loadData()
- public void saveData()
- public DataObject saveInto()
- public boolean validateStep()
- public string getNextStep()
- public MultiFormStep|boolean|void getNextStepFromDatabase()
- public string|array getNextSteps()
- public string|void getPreviousStep()
- public MultiFormStep getPreviousStepFromDatabase()
- public string getPrevText()
- public string getNextText()
- public string getSubmitText()
- public void setForm()
- public Form getForm()
- public boolean canGoBack()
- public boolean isFinalStep()
- public boolean isCurrentStep()
- public MultiFormStep addExtraClass()
- public MultiFormStep removeExtraClass()
- public string getExtraClasses()
- public mixed getValueFromOtherStep()
- public void copyValueFromOtherStep()
- public MultiFormSession getSession()
Hierarchy
Members
private
- $next_steps
protected
- $extraClasses
—
array
List of additional CSS classes for this step - $form
—
SilverStripe\MultiForm\Models\MultiForm
Form class that this step is directly related to. - $step_data_cache
—
array
Temporary cache to increase the performance for repeated look ups. - $title
—
string
Title of this step.
Methods
public
Inherited from SilverStripe\MultiForm\Models\MultiFormStep
public
- Link() — Gets a direct link to this step (only works if you're allowed to skip steps, or this step has already been saved to the database for the current {@link MultiFormSession}).
- addExtraClass() — Add a CSS-class to the step. If needed, multiple classes can be added by delimiting a string with spaces.
- canGoBack() — Determines whether the user is able to go back using the "action_back" Determines whether the user is able to go back using the "action_back" Determines whether the user is able to go back using the "action_back" form action, based on the boolean value of $can_go_back.
- copyValueFromOtherStep() — allows to get a value from another step copied over
- getExtraActions() — Additional form actions to be added to this step.
- getExtraClasses()
- getFields() — Form fields to be rendered with this step.
- getForm()
- getNextStep() — Returns the first value of $next_step
- getNextStepFromDatabase() — Returns the next step to the current step in the database.
- getNextSteps() — Accessor method for self::$next_steps
- getNextText() — Get the text to use on the button to the next step.
- getPrevText() — Get the text to the use on the button to the previous step.
- getPreviousStep() — Returns the previous step, if there is one.
- getPreviousStepFromDatabase() — Retrieves the previous step class record from the database.
- getSession() — Gets the linked MultiFormSession
- getSubmitText() — Get the text to use on the button to submit the form.
- getTitle() — Accessor method for $this->title
- getValidator() — Get a validator specific to this form.
- getValueFromOtherStep() — Returns the submitted value, if any, of any steps.
- isCurrentStep() — Determines whether the currently viewed step is the current step set in the session.
- isFinalStep() — Determines whether this step is the final step in the multi-step process or not, based on the variable $is_final_step - which must be defined on at least one step.
- loadData() — Unserialize stored session data and return it.
- removeExtraClass() — Remove a CSS-class from the step. Multiple classes names can be passed through as a space delimited string.
- saveData() — Save the data for this step into session, serializing it first.
- saveInto() — Save the data on this step into an object, similiar to {@link Form->saveInto()} - by building a stub form from {@link getFields()}. This is necessary to trigger each {@link FormField->saveInto()} method individually, rather than assuming that all data serialized through {@link saveData()} can be saved as a simple value outside of the original FormField context.
- setForm() — Sets the form that this step is directly related to.
- validateStep() — Custom validation for a step. In most cases, it should be sufficient to have built-in validation through the {@link Validator} class on the {@link getValidator()} method.