Skip to main content

Conditional Logic Injection

Dynamic Joomla Class Referencing (JPK System)

Joomla Powers is JCB’s intelligent system for referencing Joomla framework and CMS classes using dynamic placeholders, called JPKs (Joomla Power Keys). These keys abstract the actual namespace of a Joomla class — and JCB will automatically replace them with the correct use statement and fully qualified class path during compilation, based on the Joomla version you're targeting.

This feature gives developers precise control over the behavior of generated components — such as permissions, filtering, workflow rules, or dynamic form manipulation — while still benefiting from full GUI-driven reusability.

Where You Can Inject

Models

– Add logic to queries, prepare data, apply filters

Views

– Control layout decisions, prepare view variables, set document properties

Controllers

– Override save logic, access control, redirects, input sanitation
JCB provides pre-defined insertion points ("code areas") where logic can be injected via the Custom Code system — and those areas vary depending on the view or controller type.

How It Works

  • Navigate to your view, model, or controller in the JCB GUI.
  • Find the Custom Code section or designated code area.
  • Choose the context (e.g., beforeSave, afterGetItem, display, allowDelete).
  • Define your logic directly in the GUI.
  • (Optional) Wrap your logic in a condition, using PHP or JCB placeholders.
  • JCB will insert that logic at the corresponding point when compiling the component.

Related Features

Why It Matters

Maintain control over behavior without hacking generated files

Implement ACL, filtering, or data integrity logic at the right place

Apply version-specific conditions when needed

Keep your logic organized, reusable, and tracked