Reputation: 161
I get an int value to the controller and I would like to send it to the according view, but i am either passing or accesing it wrong. Here is what I am trying to do:
Controller:
function send($int = NULL) {
$this->set('integer', $int);
}
View:
echo $integer['int']
Your help is much appreciated!
Upvotes: 7
Views: 15256
Reputation: 24334
Change
echo $integer['int']
To:
echo $integer;
The first parameter in $this->set
is used as the variable name in your view, the second parameter is the value assigned to that variable.
Upvotes: 13