Reputation: 938
What's the code to programmatically get the path to jQuery in Moodle (Version 3.4)? On my recent moodle it's '/theme/jquery.php/core/jquery-1.11.3.min.js' but I need to get it dynamically in case of updates etc.
Upvotes: 0
Views: 852
Reputation: 453
The method where the URL of each jquery plugin (and the jquery library itself) is programatically build is jquery_plugin
at lib/outputrequirementslib.php
(with params jquery
and core
).
Ultimately that method builds it approximately like so:
$CFG->wwwroot . '/theme/jquery.php/core/' . $file
where $file value is taken from required file lib/jquery/plugins.php
, where the current jquery version-file is declared.
Upvotes: 1