Make link between 2 functions of a controller

I have 1 controller : C

2 functions of that controller : A and B

1 argument of the controller © : arg.

I would like to pass a value from a function to another in the same controller.

My problem is :

I set ‘arg’ in the A function.

But at the end of the function A, I render the A view.

So when I call the function B, from the view of the A view, it founds a ‘arg’ empty…

Like if the controller was built at each call to a function, and destroy when the view is render.

So I don’t know how to pass the value of ‘arg’ from A to B…

I don’t know where to save the value ‘arg’ to call it later.

I would like to let it in the same object, I’m feeling this cleaner to do it like that…

Any ideas ?

When you display a view… a server/client request/response is finished, so any call from that view is a new request/response and at that time the controller/model is again created and you have to assign again the values you need…

you can use the setState() -

or you can pass that value as a parameter to the request POST or GET

That was what I thinking…thx

I’ve tried to pass the parameter by POST but it definitely tell me the same thing each time : undifined index ‘arg’

I obviously test my parameter in my B function with isset, but it seems to don’t want to work…

In fact everything is fine until I render the view where a don’t recognize the parameter anymore, in the controller everything is fine…