Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Forms 31: Difference between revisions

From MoodleDocs
(Summary for each of the different topics)
m (Addition of Scope, Use Cases, and Requirements headings)
Line 7: Line 7:
}}
}}


=Forms for 3.1=
=Forms for 3.1 (Purpose)=


The main driving forces behind updating the forms library are a desire to create forms in JavaScript, and to make the current mforms work in php 7.
The main driving forces behind updating the forms library are a desire to create forms in JavaScript, and to make the current mforms work in php 7.
=Scope=
We are limiting ourselves to completing the following:
* Updating the current mform library to use templates and work with php 7.
* Creating AMD modules to create forms in JavaScript.


==Updating mforms==
==Updating mforms==
Line 39: Line 45:
===Form definition===
===Form definition===


MDL-52147
=Use Cases=
 
=Requirements=

Revision as of 07:13, 16 November 2015

Forms improvements targeted for Moodle 3.1
Project state Planning
Tracker issue MDL-52143
Discussion https://devpad.moodle.org/p/new_forms_lib, https://moodle.org/mod/forum/discuss.php?d=322751
Assignee Adrian Greeve


Forms for 3.1 (Purpose)

The main driving forces behind updating the forms library are a desire to create forms in JavaScript, and to make the current mforms work in php 7.

Scope

We are limiting ourselves to completing the following:

  • Updating the current mform library to use templates and work with php 7.
  • Creating AMD modules to create forms in JavaScript.

Updating mforms

Moodle currently uses mforms to create most of it's forms. We will be keeping this existing framework as a lot of work has been put in to customise it to Moodle and it still works; will maintain backwards compatibility; and will allow a gradual move to a different framework if required. Typical php forms are expected to still use this library.

php 7

Currently mforms doesn't work with php 7. This is mainly due to the use of the old constructor definition. We currently have MDL-52081 to fix the constructor throughout Moodle, including the mforms.

Mustache templates

Mustache templates have been introduced into Moodle. The current mform elements will be moved over to use the templates and become renderable. MDL-52144 is the issue number for updating the 'text' form element. See the epic issue for the full list of form elements being updated to use mustache templates.

JavaScript forms

Currently we have no library for creating a form in JavaScript. We need a library so that navigation and error handling are done in an accessible way.

Populating a form

Retrieving all information from a form ready for AJAX

MDL-52145

Form validation

MDL-52146

Form definition

Use Cases

Requirements