Creating Plugins

Plugins are loaded through the plugin_handler. It looks for directories in the Plugins folder and loads the loader.php file for each of those plugins.

Loader.php

The loader file below is a basic example of a plugin. It registers itself to the reactor global.

namespace Triekster\Reactor;

/** Plugin File
* Name: Example Plugin
* Copyright (c) 2020 Patriek Jeuriens
*/

global $reactor, $factory, $routing;

$plugin = array(
"name" => "Example Plugin",
"description" => __("Adds an empty plugin."),
"plugin" => basename(dirname(__FILE__)),
"author" => "Patriek Jeuriens",
"license" => __("Commercial License"),
"version" => 10222020, "enabled" => true
);

$reactor->plugins[$plugin["plugin"]] = $plugin;

if ($plugin['enabled'] == true) {
}

Now your plugin is loaded and any code between the plugin['enabled'] statement will be executed.


Description of the main PHP Engine loop.
Protected pages are page names that cannot be used for normal pages.
Learn how to create new plugins from scratch.
Learn how to build new themes from scratch.
Register new scripts and stylesheets.
Register new types to the core.
Register a new theme to the core.
We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.
Do you want to accept tracking cookies?