Developers

Developers

How to extend the Hubzero CMS: the framework it is built on, and how to write the components, plugins, modules, and templates that add to a hub.

The CMS is PHP. Its framework lives under core/libraries/Hubzero/ and provides the service container, routing, the database layer, events, sessions, language, and the view layer; extensions live under core/components/, core/plugins/, core/modules/, and core/templates/, and a hub can override any of them under app/.

What are you building?

Most people arrive here to add one thing to one hub. Find it below and start there; the chapters assume you will read one of them, not all of them.

You want to Write a Start at
A section of the hub with its own pages, URLs, database tables and administration screens — a booking system, a catalogue, an instrument log component Components
Behaviour that hangs off something that already exists — react to a save, add a tab to a group, add a login method, push records to an external service plugin Plugins
A small block of content placed in a template position — a list, a counter, a search box module Modules
A different look: an institution's brand, a redesigned page frame, a stylesheet override template Templates
A command run from the shell or a timer — an import, a nightly job, a repair task muse command Muse
A machine-readable endpoint for an external client API controller The REST API

Whichever it is, three chapters apply to all of them:

  • Extensions — what every extension shares: the manifest, parameters, language files, and how it gets deployed.
  • Database — the query builder, the ORM, and the migration that creates your tables. Read the table prefix section before you write a query; it is the mistake that works on your hub and fails on everyone else's.
  • Conventions — the style the tree is written in, and what a commit message looks like.

Before you write anything

New to the codebase, read these in order:

  1. Getting started — getting a hub running to develop against.
  2. Foundation — how a request is served, and how an extension is found and dispatched.
  3. Services and The basics — the facades you will use in every file: Config, Request, Lang, User, Event.

In this book

  • Getting started — development environment, browser support, file and database access, release notes.
  • Foundation — the tree, the path constants, how a class name becomes a file, the event system, the four extension kinds, the facades, and the service providers.
  • Services — cache, events, filesystem, language, server, and session.
  • The basics — configuration, requests and responses, redirects, dates, users, tags, cron, debugging, search.
  • Database — queries, the ORM, and migrations.
  • Extensions — what every extension shares: requirements, parameters, languages, deployment.
  • Modules, Components, Plugins, and Templates — one chapter set per kind of extension: structure, controllers, models, views, assets, languages, migrations, packaging.
  • Muse — the command-line tool.
  • Super groups and Super groups with GitLab.
  • Testing — the test suite, the linters, and what CI runs.
  • The REST API — the API client, versioned controllers, and the docblock tags the endpoint reference is generated from.
  • Running on AWS — what in this repository is specific to it, which is very little.
  • Video tutorials.
  • Contributing — sending a change back, and working on these pages.
  • Conventions — PHP style and naming, CSS, the database schema, and commit messages.

Reference

The generated configuration, REST API, muse, and events references list what the code declares today. They are produced from the source tree, so they say what the code says rather than what anyone remembers writing.

Rewritten and checked against 2.4-main @ 348f0057c2 on 2026-09-10.