1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php $user = null; try { $user = Database\User::fromDB($username); } catch(Exception $e) {} ?> <?php if ($user !== null): ?> <section> <?= $user->Username ?> <?= $user->Role ?> </section> <?php else: ?> <h2>User "<?= $username ?>" doesn't exist!</h2> <?php endif; ?>