Different Types of Models in Joomla

There are multiple types of model that can be used in a component. You can find the code for all the models at libraries/legacy/model folder of Joomla installation.

From Joomla 3.8, the files are shifted to: libraries/src/MVC/Model

1. JModelLegacy

It is Base class for a Joomla Model. It work as a base class by initializing the database driver object and the table object. All other models extend JModelLegacy.

2. JModelList

It is a class for handling lists of items. It provides pagination and filtering. You can use JModelList where you display a list of items. All core components rely on JModelList.

3. JModelForm

it is class for prototype form model. It is used for handling forms in Joomla. Forms can be the the User registration form or for creating and editing a record. Forms in Joomla are defined as XML files. JModelForm will load these files as JForm objects, also load form data, process the form and validate it.

4. JModelItem

It is class for prototype item model.

5. JModelAdmin

It extends JModelForm. Thus, it is also associated with forms. It adds some extra admin functionalities to the form like performing batch operations on records and ACL checks on records. It is used when editing a record or for batch operations in the back-end.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive