set() is the way to set values in your controller and get those values in your view file.
Syntax of set is-> $this->set('variable','value')
In cake-php controller you can set the values as -
set('variable1','value1');
$this->set('variable2','value2');
$this->set('variable3','value3');
?>
To set multiple value we use 'compact()' function -
Syntax of compact - $this->set(compact('varible1','variable2','variable2',......));
Ex - $data = 3;
$dataone = 4;
$datatwo = 5;
So set above in your controller's function like -
$this->set(compact('data','dataone','datatwo'));
And in view file get as -
0 Comment(s)