sorry, this is a really noob question...

When I want to print part of the $content array within node.tpl.php (for example), I'll use something like <?php print $node->content['body']['#value']; ?>

I just want to understand what the -> is all about. Presumably this indicates that $node is something other than a normal array? ( Otherwise it'd be $node['content']['body']['#value'] )

Cheers.

Accepted Answer

$node is an object and content is one of its properties, containing an array.

If the contents of 'content' was also an object, it would be

$node->content->body etc.

Written by Kevin
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki