Hotaru Docs


Hotaru Cycle

Here's a brief explanation of how Hotaru works:


Core index → Theme index → Display template → user action → Core index

What happens at each stage?

Core index

There are 2 entry points in Hotaru, index.php and admin_index.php. Everything goes through one of those files. Let's look at them:

// includes
$h = new Hotaru();
$h->start('main'); // or "admin" in admin_index.php

That's it. The settings file is included first and a new $h (Hotaru) object is constructed. The constructor and start method in Hotaru.php* sets up everything and finally displays the index template from your theme folder.

Hotaru Class

The Hotaru class is the engine of your site. It includes a number of files such as class libraries, utility files and third party extensions. It initializes the database and pulls in the settings stored in the database. It sets up Inspekt for input filtering and validation and then checks for a cookie so users can log in. The bulk of Hotaru.php is used for shortcuts to most of the functions in other classes.

Theme index

The index.php template file in your theme folder is the skeleton for how your pages are displayed. It includes a header, sidebar and footer. Each section pulls in a relevant template or is otherwise overridden by plugins**, e.g.

<!-- SIDEBAR -->
     // plugin hook
     $result = $h->pluginHook('theme_index_sidebar');
     if (!$result) {

Full details on the index.php template can be found here.

This is where the magic happens. Plugins check for parameters passed via links or forms and determine the content to display based on those parameters. If there are no plugins, Hotaru will simply display an empty template.

Display template

The index template is displayed, containing a combination of different templates, e.g. sidebar.php.

User action

When a user clicks a link or submits a form, Hotaru returns to the beginning of the cycle and rebuilds the page depending on the parameters passed by the link clicked or the form submitted.

Getting StartedDesign and LayoutPlugin DevelopmentAdvanced TopicsFunction ReferenceTroubleshooting