breadcrumbs.php 898 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. ?>
  10. <?php $items = Yii::$service->page->breadcrumbs->getItems(); ?>
  11. <?php if(is_array($items) && !empty($items)): ?>
  12. <div class="breadcrumbs">
  13. <?php $count = count($items); $i=0; ?>
  14. <?php foreach($items as $item): $i++; ?>
  15. <?php ($i == $count) ? ($str = '') : ($str = '>') ?>
  16. <?php $name = isset($item['name']) ? $item['name'] : ''; ?>
  17. <?php $name = Yii::$service->page->translate->__($name); ?>
  18. <?php $url = isset($item['url']) ? $item['url'] : ''; ?>
  19. <?php if($name): ?>
  20. <?php if($url): ?>
  21. <a href="<?= $url ?>"><?= $name ?></a> <?= $str ?>
  22. <?php else: ?>
  23. <span><?= $name ?></span> <?= $str ?>
  24. <?php endif; ?>
  25. <?php endif; ?>
  26. <?php endforeach; ?>
  27. </div>
  28. <?php endif; ?>