<?php if (!isset($this->foo)): ?>
No object model passed
<?php else: 
    $vars = get_object_vars($this->foo);
    foreach ($vars as $key => $value): ?>
<?php echo $key ?>: <?= $value ?>
<?php endforeach;
endif ?>



