My reasoning behind me wanting to do it this way is because I have an address,city, region, and country fields on my form, and then in my beforeValidate(), I am taking those values and using the Google Map API and if it's a real address w/ a accuracy level of 8, then I add in the lat, lng, and accuracy level variables to my $this->data. So there no way to pass those values back to the view?
On Sep 2, 8:50 pm, brian <bally.z...@gmail.com> wrote: > beforeValidate() is a model method. Model has it's own $data. But the > $this->data you're thinking of (I think) is handed from the controller > to the view. You would have to modify the controller's array, IOW. > Perhaps you'd be better off adding those 2 values in > Model::beforeSave(). > > > > On Wed, Sep 2, 2009 at 3:15 PM, Kyle Decot<kdec...@gmail.com> wrote: > > > I am having a little bit of trouble w/ my $this->data. When someone > > submits the form, in my beforeValidate() method, I create two new > > variables inside of $this->data ($this->data['Model']['lat'] && $this- > >>data['Model']['lng'])...I I then want to pass those back to the view > > if the validation of the rest of the form fails but when I pr($this- > >>data) in my view, lat and lng are not there. How do I make sure those > > values are passed back? Thank you for any help. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---