Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

URL manager.

Copyright: 2016 Frédéric Massart - FMCorz.net
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 191 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

url:: (12 methods):
  get()
  competency()
  framework()
  frameworks()
  plan()
  plans()
  template()
  templates()
  user_competency()
  user_competency_in_course()
  user_competency_in_plan()
  user_evidence()


Class: url  - X-Ref

URL manager class.

This class has to be used to get the URL to a resource, this allows for different
alternate frontends to be used without resorting to core hacks. Note that you
do not have to use this when you are navigating between pages of your own plugin.

To set another resolver, set the following config value in config.php:
$CFG->core_competency_url_resolver = 'your_plugin\\your_url_resolver_class';

Your URL resolver should implement the same methods as the ones listed in
this class (except for {{@link self::get()}}) but not statically.

/!\ Note, resolvers MUST NEVER assume that the resource, or the resources
represented by the arguments, still exist.

get($resource, $args)   X-Ref
Defer to the resolver.

return: mixed
param: string $resource The resource type.
param: array $args The arguments.

competency($competencyid, $pagecontextid)   X-Ref
The URL where the competency can be found.

return: moodle_url
param: int $competencyid The competency ID.
param: int $pagecontextid The ID of the context we are in.

framework($frameworkid, $pagecontextid)   X-Ref
The URL where the framework can be found.

return: moodle_url
param: int $frameworkid The framework ID.
param: int $pagecontextid The ID of the context we are in.

frameworks($pagecontextid)   X-Ref
The URL where the frameworks can be found.

return: moodle_url
param: int $pagecontextid The ID of the context that we are browsing.

plan($planid)   X-Ref
The URL where the plan can be found.

return: moodle_url
param: int $planid The plan ID.

plans($userid)   X-Ref
The URL where the plans of a user can be found.

return: moodle_url
param: int $userid The user ID.

template($templateid, $pagecontextid)   X-Ref
The URL where the template can be found.

return: moodle_url
param: int $templateid The template ID.
param: int $pagecontextid The ID of the context we are in.

templates($pagecontextid)   X-Ref
The URL where the templates can be found.

return: moodle_url
param: int $pagecontextid The ID of the context that we are browsing.

user_competency($usercompetencyid)   X-Ref
The URL where the user competency can be found.

return: moodle_url
param: int $usercompetencyid The user competency ID

user_competency_in_course($userid, $competencyid, $courseid)   X-Ref
The URL where the user competency can be found in the context of a course.

return: moodle_url
param: int $userid The user ID
param: int $competencyid The competency ID.
param: int $courseid The course ID.

user_competency_in_plan($userid, $competencyid, $planid)   X-Ref
The URL where the user competency can be found in the context of a plan.

return: moodle_url
param: int $userid The user ID
param: int $competencyid The competency ID.
param: int $planid The plan ID.

user_evidence($userevidenceid)   X-Ref
The URL where the user evidence (of prior learning) can be found.

return: moodle_url
param: int $userevidenceid The user evidence ID