Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Issuer form. More...
Public Member Functions | |
__construct ($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true, array $ajaxformdata=null) | |
Constructor. | |
definition () | |
Define the form - called by parent constructor. | |
definition_after_data () | |
This method implements changes to the form that need to be made once the form data is set. | |
Protected Member Functions | |
extra_validation ($data, $files, array &$errors) | |
Define extra validation mechanims. | |
Protected Attributes | |
string | $type |
$type | |
Static Protected Attributes | |
static array | $fieldstoremove = array('type', 'submitbutton', 'action') |
$fieldstoremove | |
static string | $persistentclass = 'core\\oauth2\\issuer' |
$persistentclass | |
Issuer form.
tool_oauth2\form\issuer::__construct | ( | $action = null, | |
$customdata = null, | |||
$method = 'post', | |||
$target = '', | |||
$attributes = null, | |||
$editable = true, | |||
array | $ajaxformdata = null ) |
Constructor.
The 'persistent' has to be passed as custom data when 'editing'. If a standard issuer is created the type can be passed as custom data, which alters the form according to the type.
Note that in order for your persistent to be reloaded after form submission you should either override the URL to include the ID to your resource, or add the ID to the form fields.
mixed | $action | |
mixed | $customdata | |
string | $method | |
string | $target | |
mixed | $attributes | |
bool | $editable | |
array | $ajaxformdata |
|
protected |
Define extra validation mechanims.
The data here:
You can modify the $errors parameter in order to remove some validation errors should you need to. However, the best practice is to return new or overriden errors. Only modify the errors passed by reference when you have no other option.
Do not add any logic here, it is only intended to be used by child classes.
stdClass | $data | Data to validate. |
array | $files | Array of files. |
array | $errors | Currently reported errors. |
array | of additional errors, or overridden errors. |