Can someone tell me what the condition is in this php statement?
return $node->type == 'article' ? mymodule_page_article($node) : mymodule_page_story($node);
I’m sorry if this is not the place to ask such a simple question but I’m finding it difficult to look up specific code structure (especially when I don’t know the name of it).
This is a ternary operator.
It’s equivalent to
What it does is: if the stuff before the
?is true, return the result of the expression in the first clause (the stuff between?and:). If it’s false, then it returns the result of the second clause (the stuff after the:).