On May 10, 5:52 pm, Enrique <[email protected]> wrote:

> The id can be found in $this->data.

No. My first thought was that the form helper would insert a hidden
field with the id - but it doesn't (and debug($this->data) shows that
the id is not present in the data).

Now I did some investigations, and I guess that if a controller uses
only one model, this model is initialized with the id set to the first
parameter passed to the action. So if you call /tests/action/123, then
$this->Test->id will be 123.

This seems to be done in the controllers "constructClasses()" method:
http://api.cakephp.org/view_source/controller/#line-426

Please correct me if I'm wrong - otherwise I'll see if I can add a
note to the documentation.

  Regards

    Jonathan

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to