This might do what your after http://debuggable.com/posts/passing-controller-variables-to-your-javascript:48b4f0c6-c718-47b2-bca1-05794834cda3
On 17 Dec, 23:29, Hipnotik <[email protected]> wrote: > Hi > I would like to build 2 javascript arrays in the view from data loaded > in controller. > > Solution 1: > use getJSON in $(document.ready) > ... not good for me > > Solution 2: > set 2 php arrays in controller's method as available in the view: > $this->set("arr1", $arr1); > $this->set("arr2", $arr2); > and the build js arrays in myview.ctp file > ... not good too... > > Is it possible to pass data from controller to js file placed in > webroot/js/ folder? Without ajax offcourse. > > Any other ideas? > > Thanks ;) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
