๐งฉ Architecture & Core Logic
- Super Powers
- Joomla Powers
- Compile Native Components, Plugins & Modules
- Multi-Version Support
- Conditional Logic Injection
- Reusable Admin Views
- Dynamic GET Builder
- Round-Trip Code Integration
- Custom Admin Views
- Site Views
- Dynamic Dashboards
- Model Linking Between Views
- Shared Field Reuse Across Views
- Drag & Drop Field Mapping
- Dynamic Field Visibility
- Independent Packaging
๐ Joomla CMS Integration
๐งฑ Custom Code System (Powerful Dual Feature)
๐ Field Type System
๐ Snippets, Templates, Layouts, Libraries
- Snippets Reusable Html Blocks
- Layouts Reusable Php Render Templates
- Templates Page Level Views Linked To Custom Admin Site Views
- Libraries JS CSS Assets Linked To UI
- CDN Local Toggle For Library Delivery
- Media Folder Injection With Override Support
- Repository Push Pull Reset Workflow
- Init Snippets Layouts Templates Via Gui
๐ฆ Packages
๐งฉ Architecture & Core Logic
๐ File & Code Management
๐ง Code Reuse & Blueprints
๐ Joomla CMS Integration
๐จ Visual GUI & UX
๐ Internationalization
๐ฆ Packaging & Distribution
โ๏ธ Compiler Engine Features
๐งฑ Custom Code System
๐ Field Type System
๐ Dynamic GET (Visual SQL Engine)
๐ Snippets, Templates, Layouts, Libraries
๐ Documentation & Metadata
๐ Analytics & Insights
๐งฉ Architecture & Core Logic
- Super Powers
- Joomla Powers
- Compile Native Components, Plugins & Modules
- Multi-Version Support
- Conditional Logic Injection
- Reusable Admin Views
- Dynamic GET Builder
- Round-Trip Code Integration
- Custom Admin Views
- Site Views
- Dynamic Dashboards
- Model Linking Between Views
- Shared Field Reuse Across Views
- Drag & Drop Field Mapping
- Dynamic Field Visibility
- Independent Packaging
๐ Joomla CMS Integration
- Token Integration
- ACL Per View, Field, Item
- Field-Based Joomla Config Generation
- Support For Joomla Categories/Tags/Custom Fields
- CLI-Ready Components
- Joomla Update Server Integration
- Version-Aware Language String Compilation
- Remote Publishing to Custom Repo Update Streams
๐ Field Type System
- Field Types Define Templates And Data Types
- Gui Defined Rules Required Unique Nullable
- Save Get Hooks Per Field
- Database Schema Auto Generated From Field Settings
- Per Display Field Rendering Config List Edit
- Create Dynamic Models With Modals Selectors
- Conditional Js And Css Per Field
๐ Snippets, Templates, Layouts, Libraries
- Snippets Reusable Html Blocks
- Layouts Reusable Php Render Templates
- Templates Page Level Views Linked To Custom Admin Site Views
- Libraries JS CSS Assets Linked To UI
- CDN Local Toggle For Library Delivery
- Media Folder Injection With Override Support
- Repository Push Pull Reset Workflow
- Init Snippets Layouts Templates Via Gui
Helper Classes & Static Utilities
Extend your components with built-in, reusable logic โ ready to call from anywhere in your codebase.
What Are Helper Classes in JCB?
Helper Classes in Joomla Component Builder (JCB) are reusable PHP classes automatically generated with every component you build. They contain utility methods, shortcuts, and logic that can be used throughout your component โ in models, controllers, layouts, templates, or custom code blocks.
These helpers are especially useful for common tasks like fetching users, formatting data, building URLs, loading configurations, and accessing your own custom logic. JCB allows you to inject your own helper methods or use the built-in ones provided out of the box.
Every compiled component includes a main helper class (e.g., com_mycomponentHelper
), and optionally static helper sub-classes that can be extended or customized.
Key Features
- ๐งฐโAuto-Generated Helper Class
Each component comes with a base helper (e.g.,MyComponentHelper.php
), included and namespaced properly. - ๐ฆโPreloaded Static Utility Methods
Includes common methods like:getCurrentUser()
getComponentParams()
getReturnPage()
checkAccess()
formatDate()
,formatCurrency()
- ๐ง โJoomla Integration
Built to interact with Joomla's core using version-aware logic (e.g.,JFactory
,JUri
). - ๐โReusable in MVC, Layouts, and Snippets
Call helper methods from models, controllers, layouts, templates, or snippets. - ๐งชโExtendable with Super Powers
Link custom interfaces, traits, or abstract logic for DRY principles and inheritance. - ๐ชโWorks with Placeholders
Use{helper:myMethod()}
โ JCB auto-converts to static calls. - ๐พโLocated in
helpers/
directory
Compiled and versioned for easy IDE indexing.
Use Cases
- ๐ Convert date/time formats in layout display using
formatDate()
- ๐ Validate permissions for specific actions with
checkAccess()
- ๐ฆ Fetch a field value from config using
getComponentParams()
- ๐ Share logic across views by defining reusable helper methods
- ๐งฉ Use in snippets via
{helper:yourMethod(params)}
Example Usage
In a layout file:
<?php echo \Joomla\Component\Mycomponent\Site\Helper\MycomponentHelper::formatDate($item->created); ?>
Or in a template/snippet with placeholder:
{helper:formatDate($item->created)}
How to Add Custom Helper Methods
- In JCB, go to the Custom Code section for the Helper class.
- Add your method using full PHP syntax (Insert Tags supported).
- JCB injects the method into the helper.php file during compile.
- Use it in layouts, views, models, or snippets.
๐ง Pro Tip: Use naming patterns like getSomething()
, isSomething()
, or formatSomething()
for clean, IDE-friendly code.
Conclusion
Helper Classes in JCB empower you to write clean, centralized logic and call it from anywhere in your component. They promote reusability, simplify maintenance, and make your codebase more organized โ especially in large projects with lots of repeated logic.