Skip to main content

Super Powers

PHP Class Builder in JCB

The "Super Powers" system in Joomla Component Builder (JCB) is a powerful abstraction tool that lets you visually create and manage namespaced PHP class structures — including interfaces, traits, abstract classes, and final implementations — all from within the GUI.

This means JCB isn't just generating Joomla components; it's also functioning as a class-oriented code factory.

What You Can Build

Using Super Powers, you can generate:

Interfaces

— with method signatures

Traits

— reusable method logic

Abstract classes

— partial implementations

Final classes

— concrete, non-extendable classes

Constants, properties, and method stubs

— the structural DNA of any class

Namespaces

— fully structured and PSR-4 compliant

How It Works

  • Create a PHP Class from the Super Powers panel
  • Define the namespace, class name, and type (interface/trait/abstract/final)
  • Add constants, methods, and properties via the GUI
  • Assign visibility (public/protected/private), default values, static flags
  • Link your class to a JCB component, or keep it globally reusable
  • Compile — and JCB inserts the class into your project automatically

Classes are generated under `/src` using your configured namespace structure and are included during compilation and packaging.

Advanced Features

Implements / Extends logic (with auto-injection into headers)

Method reuse between traits and classes

Automatic namespace path generation based on PSR-4

Use your Super Powers classes across multiple components

PHPDoc integration for auto-documentation

Use Cases

Build a utility interface (e.g. LoggerInterface) and use it across components

Create a shared trait that manages DB logic for similar views

Use abstract classes to define default controller behavior

Inject helper classes into models, views, or templates dynamically

Integration with Joomla Powers

JCB links Super Powers with Joomla Powers, meaning your custom classes can intelligently reference Joomla classes using the JPK system. This ensures compatibility across Joomla versions while maintaining clean architecture.

Rebuilding & Sync

  • Rebuilding your component re-compiles your Super Powers classes
  • Changes in the GUI will reflect on next compile
  • Use `insert/replace` tags to manually tweak parts if needed

Deployment

All Super Powers classes are packaged with the component unless explicitly excluded. They follow PSR-compliant structure and can be registered via autoloaders or JCB’s internal loader.