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        


arrayFind modules by matching a property or properties in their module info
$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
$modules->getModuleInfoProperty($class, string $property)
mixed or nullGet just a single property of module info
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
stringReturn the URL where the module can be edited, configured or uninstalled
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.115