Welcome Guest, Not a member yet? Register   Sign In
[ask]Controller: doing other function in a function.
#2

[eluser]xwero[/eluser]
Each function or variable in a class can be called by using $this-> so your code would be
Code:
class Example extends Controller {

  function doingA($varA,$varB){
    $varA+$varB;
  }

  function doingB($varA,$varB){
        return $this->doingA($varA,$varB)+1;
  }

}
I don't know why you want to specify it to $varC. If you return the result of the doingB method you can use it for other purposes.


Messages In This Thread
[ask]Controller: doing other function in a function. - by El Forum - 12-28-2007, 02:13 AM
[ask]Controller: doing other function in a function. - by El Forum - 12-28-2007, 03:23 AM
[ask]Controller: doing other function in a function. - by El Forum - 12-28-2007, 03:59 AM
[ask]Controller: doing other function in a function. - by El Forum - 01-02-2008, 08:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB