I'm trying to pass a variable array to Javascript in CakePHP 2.3, but can't get it to work. I hope someone has a good solution to this.
I have successfully passed the array to my view by placing the following in the controller:
$this->set(compact('myArray'));
And tried this in my view to pass the variable through to myJs.js.
$this->Js->set('myArray');
$this->Html->script('myJs');
Why can't I access the myArray in myJs.js?