Welcome Guest, Not a member yet? Register   Sign In
model issues
#1

[eluser]gafro[/eluser]
Alright ladies and gents,

Looking for a little assistanceSmile

Ive created a model and within that model ive created

function doSomethingCool()
{
doing somthing cool here.
}

function doSomethingAmazing()
{
doSomethingCool();
and do something amazing with the results.
}

then i get an error

"Call to undefined function doSomethingCool()."

Can't I call that function? or do I use $this->doSomethingCool(); ?

Cheers for any helpBig Grin
#2

[eluser]CroNiX[/eluser]
Did you extend the model first?
Code:
class Some_model Extends Model
{
    function Some_model()
    {
        parent::Model();
    }

    function doSomethingCool()
    {
        //your doSomethingCool function
    }
}
#3

[eluser]CroNiX[/eluser]
oh, and your doSomethingAmazing function should be:
Code:
function doSomethingAmazing()
{
    $this->doSomethingCool();
    //and do something amazing with the results.
}
#4

[eluser]gafro[/eluser]
I did extend the model/

$this->doSomethingCool();

I was missing "this"

Cheers Cronix. Big Grin

your help is much appreciated.

SOLVED!




Theme © iAndrew 2016 - Forum software by © MyBB