Welcome Guest, Not a member yet? Register   Sign In
Getting an invalid model function error when the function is declared.
#1

[eluser]doors[/eluser]
I have a crud model for my menu system.

When I load the model and try to execute three particular functions that are declared in the model I get php error stating that the model function is not declared.

The error is as follows:

Fatal error: Call to undefined method Main_model::edit_menu() ...


Can anyone tell me what is going on?
#2

[eluser]Michael Wales[/eluser]
Not without seeing some code.
#3

[eluser]bradym[/eluser]
You probably want to use

Code:
$this->edit_menu();

instead of

Code:
Main_model::edit_menu();

Take a look at http://www.php.net/manual/en/keyword.paa...otayim.php (PHP 4) or http://www.php.net/manual/en/language.oo...otayim.php (PHP 5).
#4

[eluser]doors[/eluser]
[quote author="bradym" date="1211768153"]You probably want to use

Code:
$this->edit_menu();

instead of

Code:
Main_model::edit_menu();
[/quote]

I am actually using $this->main_model->edit_menu() to access the edit_menu() function within the Main_model class model.
#5

[eluser]bradym[/eluser]
Then, as Michael said, we'll need to see some code to help you.




Theme © iAndrew 2016 - Forum software by © MyBB