breadcrumbs.php 1014 B

1234567891011121314151617181920212223242526
  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. <?php $count = count($items); $i=0; ?>
  13. <?php foreach($items as $item): $i++; ?>
  14. <?php ($i == $count) ? ($str = '') : ($str = '>') ?>
  15. <?php $name = isset($item['name']) ? $item['name'] : ''; ?>
  16. <?php $name = Yii::$service->page->translate->__($name); ?>
  17. <?php $url = isset($item['url']) ? $item['url'] : ''; ?>
  18. <?php if($name): ?>
  19. <?php if($url): ?>
  20. <li class="parent-page"><a href="<?= $url ?>"><?= $name ?></a></li>
  21. <?php else: ?>
  22. <li><?= $name ?></li>
  23. <?php endif; ?>
  24. <?php endif; ?>
  25. <?php endforeach; ?>
  26. <?php endif; ?>