Boolean comparison operator without an if statement
So it turns out you can use boolean comparison operators without an if statement:
> Anyone know what's happening with this line? the "==" in that spot is
> > completely new to me, and I can't find it in any PHP documentation... I
> > can't imagine it succeeds in doing anything (it doesn't affect the value of
> > $node->community_tags_form when I print it), but as I steal from
> > community_tags I want to be sure I don't remove anything somehow essential...
> >
> >
> > $node->community_tags_form = variable_get('community_tags_display_' .
> > $node->type, COMMUNITY_TAGS_MODE_TAB) == COMMUNITY_TAGS_MODE_INLINE;this line, just gets the value of
variable_get('community_tags_display_' .
> > $node->type, COMMUNITY_TAGS_MODE_TAB)compares it to
COMMUNITY_TAGS_MODE_INLINE
and stores the boolean result in $node->community_tags_form
Now I know.
So it turns out you can use boolean comparison operators without an if statement:
> Anyone know what's happening with this line? the "==" in that spot is
> > completely new to me, and I can't find it in any PHP documentation... I
> > can't imagine it succeeds in doing anything (it doesn't affect the value of
> > $node->community_tags_form when I print it), but as I steal from
> > community_tags I want to be sure I don't remove anything somehow essential...
> >
> >
> > $node->community_tags_form = variable_get('community_tags_display_' .
> > $node->type, COMMUNITY_TAGS_MODE_TAB) == COMMUNITY_TAGS_MODE_INLINE;this line, just gets the value of
variable_get('community_tags_display_' .
> > $node->type, COMMUNITY_TAGS_MODE_TAB)compares it to
COMMUNITY_TAGS_MODE_INLINE
and stores the boolean result in $node->community_tags_form
Now I know.
Comments
Post new comment