Module Structure

Head

Namespace statement and docblock of the ModuleName class:

<?php
namespace Redaxscript\Modules\ModuleName;

/**
 * long module description
 *
 * @since 3.0.0
 *
 * @package Redaxscript
 * @category Modules
 * @author Author Name
 */

Body

Empty ModuleName skeleton with a basic configuration:

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' => '3.0.0',
		'status' => 1,
		'access' => null
	];
}

Init

Optional method to override the default init process:

/**
 * init
 *
 * @since 3.0.0
 */

public function init()
{
}

Hook

Optional method to trigger one of the module hooks:

/**
 * ModuleHook
 *
 * @since 3.0.0
 */

public function ModuleHook()
{
}

Render

Optional method to be called inside the <module> content tag:

/**
 * render
 *
 * @since 3.0.0
 */

public function render()
{
}

Install

Optional method to override the default install process:

/**
 * install
 *
 * @since 3.0.0
 */

public function install()
{
}

Uninstall

Optional method to override the default uninstall process:

/**
 * uninstall
 *
 * @since 3.0.0
 */

public function uninstall()
{
}
Edit on GitHub