Is it possible to run two ternary conditionals, concatenating the results of the second to the first?
My conditionals read as follows:
$tr_class = (!$pinned ?: "warning");
$tr_class .= ($read ?: " unread");
echo "<tr class='" . $tr_class . "'>";
If something is $pinned
but !$read
, I should get:
<tr class='warning unread'>
But I only get the ' unread'
? It seems like the second ternary conditional is overwriting the former, and not concatenating?
Is there away around this, without writing full if/else statements?