Control configuration of RequireJS.
More...
Control configuration of RequireJS.
Definition at line 12 of file Config.php.
Constructor.
- Parameters
-
\Elgg\EventsService | $events | The events service |
Definition at line 32 of file Config.php.
Elgg\Amd\Config::addDependency |
( |
string |
$name | ) |
|
Add a dependency.
- Parameters
-
string | $name | Name of the dependency |
- Returns
- void
Definition at line 152 of file Config.php.
Elgg\Amd\Config::addModule |
( |
|
$name, |
|
|
array |
$config = [] |
|
) |
| |
Adds a standard AMD or shimmed module to the config.
- Parameters
-
string | $name | The name of the module |
array | $config | Configuration for the module
- url: string The full URL for the module if not resolvable from baseUrl
- deps: array Shimmed module's dependencies
- exports: string Name of the shimmed module to export
|
- Returns
- void
Definition at line 198 of file Config.php.
Elgg\Amd\Config::addPath |
( |
string |
$name, |
|
|
string |
$path |
|
) |
| |
Add a path mapping for a module.
If a path is already defined, sets current path as preferred.
- Parameters
-
string | $name | Module name |
string | $path | Full URL of the module |
- Returns
- void
Definition at line 56 of file Config.php.
Elgg\Amd\Config::addShim |
( |
string |
$name, |
|
|
array |
$config |
|
) |
| |
Configures a shimmed module.
- Parameters
-
string | $name | Module name |
array | $config | Configuration for the module
- deps: array Dependencies
- exports: string Name of the shimmed module to export
|
- Returns
- void
- Exceptions
-
Definition at line 104 of file Config.php.
Elgg\Amd\Config::getConfig |
( |
| ) |
|
Get the configuration of AMD.
- Returns
- array
Definition at line 258 of file Config.php.
Elgg\Amd\Config::getDependencies |
( |
| ) |
|
Get registered dependencies.
- Returns
- array
Definition at line 172 of file Config.php.
Elgg\Amd\Config::hasDependency |
( |
|
$name | ) |
|
Is this dependency registered.
- Parameters
-
- Returns
- bool
Definition at line 183 of file Config.php.
Elgg\Amd\Config::hasModule |
( |
|
$name | ) |
|
Is module configured?
- Parameters
-
- Returns
- bool
Definition at line 237 of file Config.php.
Elgg\Amd\Config::hasShim |
( |
|
$name | ) |
|
Is this shim defined.
- Parameters
-
string | $name | The name of the shim |
- Returns
- bool
Definition at line 130 of file Config.php.
Elgg\Amd\Config::removeDependency |
( |
string |
$name | ) |
|
Removes a dependency.
- Parameters
-
string | $name | Name of the dependency |
- Returns
- void
Definition at line 163 of file Config.php.
Elgg\Amd\Config::removeModule |
( |
|
$name | ) |
|
Removes all config for a module.
- Parameters
-
string | $name | The module name |
- Returns
- void
Definition at line 224 of file Config.php.
Elgg\Amd\Config::removePath |
( |
|
$name, |
|
|
|
$path = null |
|
) |
| |
Remove a path for a module.
- Parameters
-
string | $name | Module name |
mixed | $path | The path to remove. If null, removes all paths (default). |
- Returns
- void
Definition at line 76 of file Config.php.
Elgg\Amd\Config::removeShim |
( |
|
$name | ) |
|
Unregister the shim config for a module.
- Parameters
-
- Returns
- void
Definition at line 141 of file Config.php.
Elgg\Amd\Config::setBaseUrl |
( |
|
$url | ) |
|
Set the base URL for the site.
- Parameters
-
- Returns
- void
Definition at line 43 of file Config.php.
The documentation for this class was generated from the following file: