Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-51718-set-scheme -
Description
The scheme can be set in the constructor but not changed afterwards. Seems like simply an omission in the moodle_url api as it is an edge case, but it is still quite valid and means you don't have to construct a url, encode it, and then re-parse it and replace the scheme afterwards.
require_once('config.php');
$url = new moodle_url('/local/blah/someapi');
$url->set_scheme('myscheme');
echo $url; --> "myscheme://moodle.example.com/local/blah/someapi"