Welcome Guest, Not a member yet? Register   Sign In
setting variables in controller confusion
#1

[eluser]september28[/eluser]
Hi there,

Just wondering if i have 2 functions in a controller say add and add2, could i set a variable in add and then reuse it in add2??

eg.
Code:
function add() {
    $this->myvariable = 'hello';
}

function add2() {
    echo $this->myvariable;
}

In my particular example each function is a different stage of a form and i only want to have to define the id for a record once and then reuse it at various stages of the form (add, add2 and add2)

Thnaks in advance


Messages In This Thread
setting variables in controller confusion - by El Forum - 05-05-2009, 10:49 AM
setting variables in controller confusion - by El Forum - 05-05-2009, 11:18 AM
setting variables in controller confusion - by El Forum - 05-05-2009, 11:49 AM
setting variables in controller confusion - by El Forum - 05-05-2009, 12:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB