Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

Customfield package

Copyright: 2018 David Matamoros <davidmc@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 214 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: field_config_form  - X-Ref

Class field_config_form

definition()   X-Ref
Class definition


validation($data, $files = array()   X-Ref
Field data validation

param: array $data
param: array $files
return: array

get_field()   X-Ref
Get field

return: field_controller

check_access_for_dynamic_submission()   X-Ref
Check if current user has access to this form, otherwise throw exception

Sometimes permission check may depend on the action and/or id of the entity.
If necessary, form data is available in $this->_ajaxformdata

set_data_for_dynamic_submission()   X-Ref
Load in existing data as form defaults

Can be overridden to retrieve existing values from db by entity id and also
to preprocess editor and filemanager elements

Example:
$this->set_data(get_entity($this->_ajaxformdata['id']));

process_dynamic_submission()   X-Ref
Process the form submission

This method can return scalar values or arrays that can be json-encoded, they will be passed to the caller JS.

return: mixed

get_context_for_dynamic_submission()   X-Ref
Form context

return: \context

get_page_url_for_dynamic_submission()   X-Ref
Page url

return: \moodle_url