Main module class - Jet\Application_Module
Every module must have a Main class, and it must be a descendant of that class (or of another class that is a descendant of that class).
The Main class is like a gateway to the module and therefore provides several necessary methods.
Method | Meaning of |
---|---|
public __construct( Application_Module_Manifest $manifest ) |
The constructor only takes an instance of manifest, which is further instantiated by the main module class. It does not perform any other operations. |
public getModuleManifest( ): Application_Module_Manifest |
Returns an instance of the manifest module. |
public install( ): void |
Performs the module installation. More precisely, it calls the installation script, if it exists. It no longer saves meta-information about installed modules. That is handled by handler. |
public uninstall( ): void |
Deinstall the module. More precisely, it calls the uninstall script, if it exists. It no longer saves meta-information about installed modules. That is handled by handler. |
public getViewsDir( ): string |
Returns the full path to the directory where the view scripts belonging to the module are located. |
public actionIsAllowed( string $action ): bool |
Verifies whether the ACL action is enabled (authorized - that is, whether the user has sufficient permissions). The default implementation verifies the existence of such an action and calls the authorization subsystem. |
Of course, you have the option to overload all methods if you need to.