Module Basics

Modules are located inside the modules directory and can be installed and edited under admin/view/modules.

Hidden feature

The documentation can be found while editing a module, each PHTML file inside the docs directory represents a tab.

Edit on GitHub

Module Overview

NameDescription
AceJavaScript powered HTML editor
Alias GeneratorJavaScript powered alias generator
AnalyticsIntegrate Google Analytics
ArchiveGenerate a archive tree
Call HomeProvide version updates and news
ContactSimple contact form
CSS ValidatorCSS validator for developers
DebuggerDebugger for developers
DemoEnable anonymous login
DialogJavaScript powered dialog
Directory ListerList files of a directory
DisqusReplace comments with Disqus
ExperimentsIntegrate Google Experiments
Feed GeneratorGenerate Atom feeds
Feed ReaderRead external RSS and Atom feeds
Form ValidatorJavaScript powered form validation
GalleryJavaScript powered gallery
HTML ValidatorHTML validator for developers
Live ReloadLive reload for developers
MapsIntegrate Google Maps
Page CacheHigh performance caching for pages
PreviewOverview of the elements
ReporterReports on the dashboard
SitemapGenerate a sitemap tree
Sitemap XMLSubmit a sitemap to search engines
Social SharerIntegrate social sharer
Syntax HighlighterJavaScript powered syntax highlighter
TableSorterJavaScript powered table sorter
TestDummyTest Dummy
Textarea ResizerJavaScript powered textarea resizer
TinymceJavaScript powered WYSIWYG editor
Edit on GitHub

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

Module Hooks

General

NameType
inittrigger
renderStarttrigger
renderEndtrigger
templateReplacetrigger
templateStarttrigger
templateEndtrigger
cronUpdatetrigger

Router

NameType
routeHeadertrigger
routeContenttrigger

Article

NameType
articleReplacetrigger
articleStarttrigger
articleEndtrigger
articleFragmentStarttrigger
articleFragmentEndtrigger

Byline

NameType
bylineStarttrigger
bylineEndtrigger

Extra

NameType
extraReplacetrigger
extraStarttrigger
extraEndtrigger
extraFragmentStarttrigger
extraFragmentEndtrigger

Comment

NameType
commentReplacetrigger
commentStarttrigger
commentEndtrigger
commentFragmentStarttrigger
commentFragmentEndtrigger

Breadcrumb

NameType
breadcrumbStarttrigger
breadcrumbEndtrigger

Pagination

NameType
paginationStarttrigger
paginationEndtrigger

Navigation

NameType
navigationCategoryStarttrigger
navigationCategoryEndtrigger
navigationArticleStarttrigger
navigationArticleEndtrigger
navigationCommentStarttrigger
navigationCommentEndtrigger
navigationLanguageStarttrigger
navigationLanguageEndtrigger
navigationTemplateStarttrigger
navigationTemplateEndtrigger

Form

NameType
commentFormStarttrigger
commentFormEndtrigger
consoleFormStarttrigger
consoleFormEndtrigger
installFormStarttrigger
installFormEndtrigger
loginFormStarttrigger
loginFormEndtrigger
recoverFormStarttrigger
recoverFormEndtrigger
registerFormStarttrigger
registerFormEndtrigger
resetFormStarttrigger
resetFormEndtrigger
searchFormStarttrigger
searchFormEndtrigger

Admin Router

NameType
adminRouteHeadertrigger
adminRouteContenttrigger

Admin Panel

NameType
adminPanelStarttrigger
adminPanelEndtrigger

Admin Notification

NameType
adminNotificationcollect

Admin Dashboard

NameType
adminDashboardStarttrigger
adminDashboardEndtrigger
adminDashboardcollect

Admin Dock

NameType
adminDockStarttrigger
adminDockEndtrigger

Admin Form

NameType
adminArticleFormStarttrigger
adminArticleFormEndtrigger
adminCategoryFormStarttrigger
adminCategoryFormEndtrigger
adminCommentFormStarttrigger
adminCommentFormEndtrigger
adminExtraFormStarttrigger
adminExtraFormEndtrigger
adminGroupFormStarttrigger
adminGroupFormEndtrigger
adminModuleFormStarttrigger
adminModuleFormEndtrigger
adminSettingFormStarttrigger
adminSettingFormEndtrigger
adminUserFormStarttrigger
adminUserFormEndtrigger

Admin Table

NameType
adminArticleTableStarttrigger
adminArticleTableEndtrigger
adminCategoryTableStarttrigger
adminCategoryTableEndtrigger
adminCommentTableStarttrigger
adminCommentTableEndtrigger
adminExtraTableStarttrigger
adminExtraTableEndtrigger
adminGroupTableStarttrigger
adminGroupTableEndtrigger
adminModuleTableStarttrigger
adminModuleTableEndtrigger
adminUserTableStarttrigger
adminUserTableEndtrigger
Edit on GitHub