Module
in package
implements
ModuleInterface
AbstractYes
Base module class.
For built-in (classic) modules, the migration is relatively simple:
class HomePageModule extends Module
{
uses ModuleSiteTrait;
}
- anchors the module path to the class directory
- loads
sprout_load.phpandadmin_load.phpfiles (if present, co-located in the directory) - module name is derived from the class, e.g.
'HomePage'.
Table of Contents
Interfaces
- ModuleInterface
- Interface for SproutCMS modules.
Methods
- getName() : string
- Get the name of this module.
- getPath() : string
- Get the absolute path of this module.
- isLoaded() : bool
- loadAdmin() : void
- Execute admin setup.
- loadSprout() : void
- Execute initial setup.
Methods
getName()
Get the name of this module.
public
static getName() : string
Tags
Return values
stringgetPath()
Get the absolute path of this module.
public
getPath() : string
Tags
Return values
stringisLoaded()
public
isLoaded([string $type = 'sprout' ]) : bool
Parameters
- $type : string = 'sprout'
Tags
Return values
boolloadAdmin()
Execute admin setup.
public
loadAdmin() : void
Tags
loadSprout()
Execute initial setup.
public
loadSprout() : void