Talk:Form API: Difference between revisions
From MoodleDocs
Line 1: | Line 1: | ||
== Usage == | == Usage == | ||
This section says: "For creating a form in moodle, you have to create class extending moodleform class", but WHERE do you create this class? Which .php file? | This section says: "For creating a form in moodle, you have to create class extending moodleform class", but WHERE do you create this class? Which .php file? Is it simplehtml_form.php? | ||
Below the "class simplehtml_form extends moodleform" sample code the doc then says: "Then instantiate form (in this case simplehtml_form) on your page." Where do you instantiate the form? In the view.php page? | |||
Lastly, where do you put the code that processes and saves the form data when the form is submitted? | |||
The documentation should be clear about where you should put all the different sections of code. |
Revision as of 13:54, 1 April 2016
Usage
This section says: "For creating a form in moodle, you have to create class extending moodleform class", but WHERE do you create this class? Which .php file? Is it simplehtml_form.php?
Below the "class simplehtml_form extends moodleform" sample code the doc then says: "Then instantiate form (in this case simplehtml_form) on your page." Where do you instantiate the form? In the view.php page?
Lastly, where do you put the code that processes and saves the form data when the form is submitted?
The documentation should be clear about where you should put all the different sections of code.