Im wondering how I can set some variables in my controller, and then be able to access them in my model and a behaviour for that model.
I have tried the below, but with no luck:
in controller: $this->Model->data[‘foo’]=”bar”;
in behaviour: $Model->data[‘foo’];
Grateful for any help!
One way to pass data is through user-defined functions in your model.
For example,
In the Model,
You could also pass them in as a reference if you wish to make direct changes to the data: