Skip to main content

Auto Model Method Generation

By treating your blueprint as code, you gain control, collaboration, and automation โ€” all while retaining the visual editing power of JCB

What It Does

Each Dynamic GET you create in Joomla Component Builder (JCB) can be compiled into a dedicated model method. This method encapsulates the entire logic of the GET โ€” joins, filters, ordering, limits, and more โ€” and is inserted directly into your componentโ€™s model class.

These methods:

  • Are uniquely named after the GET (e.g. getGreetingListData)
  • Return pre-structured result sets (arrays, objects, or single rows)
  • Are Joomla-native and use $db, $query, and helper APIs
  • Can be reused in templates, layouts, controllers, or other custom code blocks

Benefits

  • ๐Ÿ›  No Coding Required
    Dynamic GETs are visually designed. JCB handles the conversion to full model method logic during compilation.
  • ๐Ÿ” Fully Reusable
    Once generated, you can call the method from any controller, view, or layout with minimal effort.
  • ๐ŸŽฏ Scoped to Views
    Each view can have one or more GETs; each becomes its own method, keeping logic clean and modular.
  • ๐Ÿงฑ Follows Joomla Conventions
    Output is Joomla 3.x, 4.x, or 5.x safe and uses proper query building with protection against SQL injection.

Where You Find the Method

Compiled inside the relevant Model class for the view (Site or Admin). You can search for get[YourDynamicGETName] in the compiled code.

Use Cases

  • Pull item data into templates
  • Build data providers for custom dashboards
  • Populate dropdowns, sidebars, or repeaters
  • Inject data into JavaScript via helper calls

Conclusion

Auto Model Method Generation removes the tedium of writing backend data logic by hand. With each Dynamic GET converted into a ready-to-use method, you get reliable, repeatable, and efficient code output โ€” with zero duplication or manual work.