Module Structure
Head
Namespace statement and docblock of the ModuleName
class:
<?php namespace Redaxscript\Modules\ModuleName; /** * long module description * * @since 4.0.0 * * @package Redaxscript * @category Modules * @author Author Name */
Body
Empty ModuleName
skeleton:
class ModuleName extends Module\Module { /** * array of the module * * @var array */ protected static $_moduleArray = [ 'name' => 'Module Name', 'alias' => 'ModuleName', 'author' => 'Author Name', 'description' => 'Long module description', 'version' => '4.0.0' ]; }
Init
Optional method to override the default init process:
/** * init * * @since 4.0.0 */ public function init() { }
Hook
Optional method to trigger one of the module hooks:
/** * ModuleHook * * @since 4.0.0 */ public function ModuleHook() { }
Render
Optional method to be called inside the <module>
content tag:
/** * render * * @since 4.0.0 */ public function render() { }
Install
Optional method to override the default install process:
/** * install * * @since 4.0.0 */ public function install() { }
Uninstall
Optional method to override the default uninstall process:
/** * uninstall * * @since 4.0.0 */ public function uninstall() { }Edit on GitHub