What are the differences between Joomla Model Types?
Asked 07 September, 2021
Viewed 2K times
  • 67
Votes

I'm trying to get to grips with the power behind Joomla (3.x)'s framework.

I've noticed that there are multiple types of model that can be used in a component:


JModelAdmin

Prototype admin model. Acts as a Factory class for application specific objects and provides many supporting API functions.

JModelLegacy

Base class for a Joomla Model Acts as a Factory class for application specific objects and provides many supporting API functions.

JModelList

Model class for handling lists of items. Acts as a Factory class for application specific objects and provides many supporting API functions.

JModelForm

Prototype form model. Acts as a Factory class for application specific objects and provides many supporting API functions.

JModelItem

Prototype item model.


I understand that JModelLegacy seems to be the foundation class. My models have been extending JModelLegacy by default, however, I was wondering if I could be potentially using the benefits from the other classes.

If there was someone who knows about these models, I would appreciate having an explanation about what the differences are between these model classes, and an intended scenario where you would use one over others.

1 Answer