How to Use a method of a model in the same model Class

Hi to everybody,

can i and how use a function (method) of a model class in anoter method of the same model?


class mymodel extends Model

function mymodel()

fucntion firtMethod()
   //Call the second method

function secondMethod($var)
  fetch something;
  retutn result;


i got!

i'm sorry, i need to put the echo before the function

like this:

echo this->secondMethod($realVar);

[eluser]Phil Sturgeon[/eluser]
Yeah that works fine. Did you try before you posted?

no i'm sorry.

i think that if i write return is not necessary to put echo

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.