2022-11-01, 00:44:25
(2013-05-25, 06:31:47)mvlcek Wrote:(2013-05-25, 06:18:58)lnickel Wrote: So I take this code and make a component from it and call it it as a param in the get_nav function. Cool. Just dont know how to do the if/else
PHP code between <?php and ?>, HTML outside:
Code:<li class="<?php echo $item->classes; ?>">
<?php if ($item->hasChildren) { ?>
<a href="<?php echo htmlspecialchars($item->link); ?>">
<?php echo htmlspecialchars($item->text); ?>
</a>
<?php } else { ?>
<?php echo htmlspecialchars($item->text); ?>
<?php } ?>
<?php if ($item->isOpen) { ?>
<ul><?php $item->outputChildren(); ?></ul>
<?php } ?>
</li>
You could of course also write the else-part simply as
Code:<?php } else { echo htmlspecialchars($item->text); } ?>
Hi mvlcek,
I am using i18n for php8 but the component paramter doesn't work, is possible to fix it? I need to put there a custom rendering. Thanks