On 9/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> If I use $this->set('post',$this->Post->read()); in the controller
>
> Why do I have to access it like this in the view:
>
> echo $post['Post']['id'];
>
> Shouldn't the proper way be echo $post['id'];
>
> Is this a bug? Has the spec changed in 1.2? I went through the code
> for the read() function in /cake/libs/model.php and all it does is
> return $this->data. Has $this->data has changed from 1.1?
That's not a bug. Data is always returned in this format:
Array
(
[ModelName] => Array
(
[fieldname1] => 'value'
[fieldname2] => 'value'
)
)
Hope that helps.
--
Chris Hartjes
Senior Developer
Cake Development Corporation
My motto for 2007: "Just build it, damnit!"
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---