Loads and manages all modules in ProcessWire.

The $modules API variable is most commonly used for getting individual modules to use their API.

// Getting a module by name
$m = $modules->get('MarkupPagerNav');

// Getting a module by name (alternate)
$m = $modules->MarkupPagerNav;

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Modules class also inherits all the methods and properties of: WireArray and Wire.

Common / Manipulation / Configuration

Show “$modules”             Show Arguments        


$modules->findByPrefix(string $prefix)
arrayFind modules matching the given prefix (i.e. “Inputfield”)
Module, _Module or nullGet the requested Module
Module, _Module, null or stringGet the requested Module (with options)
bool or stringGet the path + filename (or optionally URL) for this module
arrayReturns an associative array of information for a Module
arrayReturns a verbose array of information for a Module
$modules->isInstalled(string $class)
boolIs the given module name installed?


$modules->delete(string $class)
bool or intDelete the given module, physically removing its files
$modules->install(string $class)
null or ModuleInstall the given module name
(nothing)Refresh the modules cache
$modules->saveConfig($class, $data)
boolSave provided configuration data for the given module
$modules->uninstall(string $class)
boolUninstall the given module name


arrayGiven a module name, return an associative array of configuration data for it
bool, string or intIs the given module configurable?
$modules->saveConfig($class, $data)
boolSave provided configuration data for the given module

Additional methods and properties

In addition to the methods and properties above, Modules also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.84