Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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