core/url

URL utility functions.

Source:
Since:
  • 2.9
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Methods

(inner) fileUrl(relativeScript, slashArg) → {string}

Source:

Construct a file url

Parameters:
Name Type Description
relativeScript string
slashArg string
Returns:
Type
string

(inner) imageUrl(imagename, component) → {string}

Source:

Wrapper for image_url function.

Parameters:
Name Type Description
imagename string

The image name (e.g. t/edit).

component string

The component (e.g. mod_feedback).

Returns:
Type
string

(inner) relativeUrl(relativePath, params, includeSessKey) → {string}

Source:

Take a path relative to the moodle basedir and do some fixing (see class moodle_url in php).

Parameters:
Name Type Description
relativePath string

The path relative to the moodle basedir.

params object

The query parameters for the URL.

includeSessKey bool

Add the session key to the query params.

Returns:
Type
string