---
title: "Fatal error: Call to undefined method &#8211; Joomla 3 Component Development"
description: "When creating a Joomla 3 component, you can declare functions / methods within your models. When calling these methods in your views, you might see an error similar to the following: Fatal error:..."
url: https://www.inmotionhosting.com/support/edu/joomla/joomla-3/undefined-method/
date: 2014-05-23
modified: 2023-06-08
author: "Brad Markle"
categories: ["Joomla", "Joomla 3", "Website Error Numbers"]
tags: ["Joomla v3"]
type: post
lang: en
---

# Fatal error: Call to undefined method &#8211; Joomla 3 Component Development

When [creating a Joomla 3 component](https://www.inmotionhosting.com/support/edu/joomla/joomla-3/intro/), you can declare functions / methods within your [models](https://www.inmotionhosting.com/support/edu/joomla/joomla-3/add-new-model/). When calling these methods in your [views](https://www.inmotionhosting.com/support/edu/joomla/joomla-3/add-new-view/), you might see an error similar to the following:

**Fatal error: Call to undefined method** ComponentViewName::yourMethod() in /home/userna5/public_html/components/com_component/views/component/view.html.php on line 19

This error can be resolved using [the getModel method](https://docs.joomla.org/API16:JController/getModel), and this is how you can edit your view.html.php file to do so.

| Replace this: | $this->someMethod(); |
| --- | --- |
| With this: | $model = $this->getModel(); $model->someMethod(); |

Below, we’ve created a screenshot that shows the getModel method being used:

[![getModel method in action](/support/images/stories/edu/joomla-3/create-component/getModel-in-action.png)](/support/images/stories/edu/joomla-3/create-component/getModel-in-action.png)
