MVC-GETINSTANCE-001

JModelLegacy::getInstance()

getInstance() on MVC classes

String getInstance on models/controllers/views is deprecated. MVC Factory resolves namespaced classes.

JModelLegacy::getInstance()$this->getModel() / MVCFactory

Dies at Joomla 5 → 6J3: Works nativelyJ4: Deprecated — do not shipJ6: Deprecated — do not shipBC plugin: not applicablePatch possible — review itMVC

What you will see

  • Model class not found

Symptoms people search

getInstance model · cannot load model after namespace

Replace this code

Swap JModelLegacy::getInstance() for $this->getModel() / MVCFactory.

Joomla 3

Remove or stop calling this

$model = JModelLegacy::getInstance('Courses', 'LmsModel');

Joomla 4 / 6

Use this instead

$model = $this->getModel('Courses');

How to fix it

  1. 1Use $this->getModel() in controllers.
  2. 2Register the MVC factory in services/provider.php.

Also known as

JModelLegacy::getInstance · JControllerLegacy::getInstance

Related issues

Get in touch

Have a project in mind? Let's talk about it.

Tell us what you're building. Whether it's a new site, an online store, a mobile app, or something that needs AI under the hood, we'll get back to you within a business day.

Free consultation
No commitment, no pressure
Reply within 24 hours
Usually much faster

Prefer a direct conversation?

Request a project quote

Tell us about your project

Fill out the quick form and we'll reach out.