Re: Passing (json) value to javascript in PHP4
On 16 Dic, 11:29, Dave wrote: > do you have the latest pull from the git repo on both test and production > servers? I updated to 1.2.5 and the problem disappeared! :-) Thank you for the suggestion. maxx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Passing (json) value to javascript in PHP4
On 16 Dic, 11:29, Dave wrote: > do you have the latest pull from the git repo on both test and production > servers? I'm using cake_1.2.3.8166 both on server and on my pc. Always in a hurry, I had no time to upgrade to 1.2.5. Do you think that upgrading could solve the problem? Thank you maxx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Passing (json) value to javascript in PHP4
do you have the latest pull from the git repo on both test and production servers? On Tue, Dec 15, 2009 at 7:50 AM, emmexx wrote: > I've been trying to pass a field value to javascript for the last 3 > days with no avail. > > First of all on my development pc I have php5. On my test/productin > server php4. > > I put in the controller view function: > > $tracks = $this->Track->find( >'all', >array( >'conditions'=>array('Track.path_id' => $id, >'contain' => array('Track.gpstrack') >) >); > $this->set(compact('tracks')); > > //Track.gpstrack contains a GML file (something like Gmaps KML files) > > In the view.ctp file: > $tmp= "var phptracks=".$javascript->object($tracks); > echo $javascript->codeBlock($tmp); > > On my pc this works perfectly. > On the test server $javascript->object formats the $tracks array in a > different way. There's a different number of escape backslashes and > the javascript variable phptracks isn't even initialised. FF and > firebug error log report: "missing } after property list". > I suppose this has something to do with encode_json() function missing > in php4 but I don't understand why there's such difference in escaping > the field value. I mean the variable seems to be formatted almost > perfectly for javascript, why those missing backslashes in php4? Is it > wrong or incomplete cakephp code? > Should I implement an encode_json() function for php4? Should I code > this in a completely different way? > > Thank you >maxx > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Passing (json) value to javascript in PHP4
I've been trying to pass a field value to javascript for the last 3 days with no avail. First of all on my development pc I have php5. On my test/productin server php4. I put in the controller view function: $tracks = $this->Track->find( 'all', array( 'conditions'=>array('Track.path_id' => $id, 'contain' => array('Track.gpstrack') ) ); $this->set(compact('tracks')); //Track.gpstrack contains a GML file (something like Gmaps KML files) In the view.ctp file: $tmp= "var phptracks=".$javascript->object($tracks); echo $javascript->codeBlock($tmp); On my pc this works perfectly. On the test server $javascript->object formats the $tracks array in a different way. There's a different number of escape backslashes and the javascript variable phptracks isn't even initialised. FF and firebug error log report: "missing } after property list". I suppose this has something to do with encode_json() function missing in php4 but I don't understand why there's such difference in escaping the field value. I mean the variable seems to be formatted almost perfectly for javascript, why those missing backslashes in php4? Is it wrong or incomplete cakephp code? Should I implement an encode_json() function for php4? Should I code this in a completely different way? Thank you maxx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en