Saturday, December 27, 2008

Re: Accessing $this->data in views

On Dec 9, 8:02 pm, WebbedIT <p...@webbedit.co.uk> wrote:

> However when I then try to access the $dataarray elsewhere in the
> view it is undefined?!?

If anyone else is trying to change $this->data in a view, and is about
to be desperate, because it doesn't affect the form fields, I just
realized, that $form->data is initialized with a copy of $this->data
when the view is initialized.

This means, that you must change $form->data, if you want to change
form data in the view !

Regards

Jonathan

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: