<?php echo isset($areas['footer']) ? $areas['footer'] : null; ?>
Any way to improve that?
<?php echo isset($areas['footer']) ? $areas['footer'] : null; ?>
Any way to improve that?
Note that you are echoing and in false condition it would be null
which does not have any effect. You could say like 'empty'
or ' '
or 'not found'
instead. Other alternative is to get the return value of isset
:
$return = isset($areas['footer']) ? $areas['footer'] : null;
if ($return)
{
// $return contains footer info
}
else
{
// footer was not set :(
}