interacts_with_forms
trait interacts_with_forms
| internal |
Trait handling Moodle Form interactions within controllers.
Properties
| protected object|string|null | $form | ||
| protected mixed | $formparams |
Methods
void
set_form(object|string $form, mixed $formparams = null)
Set the form for the controller to handle.
bool
handle_form_submission()
Check if the bound form was submitted and validated.
mixed
process_form_submission()
Return submitted form data when valid, otherwise false.
bool
process_form_cancel()
Determine if the form has been cancelled.
bool
is_form_submitted()
Check if the form was submitted (regardless of validation).
string
render_form_html()
Internal helper to render the form and return HTML.
Details
at line 43
void
set_form(object|string $form, mixed $formparams = null)
Set the form for the controller to handle.
at line 65
protected bool
handle_form_submission()
Check if the bound form was submitted and validated.
at line 73
protected mixed
process_form_submission()
Return submitted form data when valid, otherwise false.
at line 85
protected bool
process_form_cancel()
Determine if the form has been cancelled.
at line 97
protected bool
is_form_submitted()
Check if the form was submitted (regardless of validation).
at line 105
protected string
render_form_html()
Internal helper to render the form and return HTML.