Hi. I've been working with Cake for a while and something always comes
up to my mind when writing a view, which I'll share:

We all know how Cake spits a simple find('first'), right:

Array
(
    [ModelName] => Array
        (
            [id] => 83
            [field1] => value1
        )
    [AssociatedModelName] => Array
        (
            [id] => 1
            [field1] => value1
        )
)

Now, I find it tiresome to have to type the ['ModelName'] everytime I
want to play with the data. And also sometimes it seems a little
redundant. For example: What do you usually do when finding an
article:

$article = $this->Articles->findById(1); (using $data all the time
seems little intuitive for me since sometimes we have a lot of
different data shipping to the view)

To get the name of the article we would use $article['Article']
['name']. See... article->Article->name.

And I keep thinking that since, by convention, all model names are
CamelCased, and fieldnames are lowercased, and arrays are case
sensitive, usually, we wouldn't have a collision and then we would
have more beatiful data:

$article['name'];
$article['Author']['name'];
and so forth....


so, what am I missing here? :-)

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to