Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.9
-
None
-
None
-
MOODLE_19_STABLE
Description
I attach a simple patch to optionally pass a moodle_url object (see http://docs.moodle.org/en/Development:lib/weblib.php_moodle_url) as the action of a form instead of a string to the moodle_form constructor
The code checks if the $action param is a string or a moodle_url object. If it is a moodle_url object the object outputs the action url without any GET params and the params stored in the moodle_url oject are output as hidden params.
This is useful for complex pages where there are many GET params passing data from page call to page call. The hidden params can be used to pass an array of params not related to the form action from page to page. And the page params will always be processed in one place by optional_param / required_param at the top of the script.
The params are not output by the get_data method.