Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="widget widgetMenu widgetMainMenu">
- <ul>
- <?= $this->getHelper('partialLoop')
- ->setObjectKey('menuItem')
- ->refVars('currentPage')
- ->partialLoop('_partials/widget/menu/main/item.phtml', $this->menuItems) ?>
- </ul>
- </div>
- Файл item.phtml
- <?
- $this->active = in_array($this->menuItem->pageId, $this->currentPage->pathIds);
- $this->hasChildren = $this->active && count($this->menuItem->children);
- ?>
- <li<?= ($this->active ? ' class="active"' : ' class="inactive"') ?>>
- <a href="<?= $this->pageUrl($this->menuItem) ?>"<?= ($this->hasChildren ? ' class="hasChildren"' : '') ?>>
- <span class="menuItemContent">
- <?= $this->menuItem->contents->name ?>
- </span>
- </a>
- <? if($this->hasChildren): ?>
- <ul>
- <?= $this->getHelper('partialLoop')
- ->setObjectKey('menuItem')
- ->refVars('currentPage')
- ->partialLoop('_partials/widget/menu/main/item-2.phtml', $this->menuItem->children) ?>
- </ul>
- <? endif; ?>
- </li>
- Файл item-2.phtml
- <?
- $this->active = in_array($this->menuItem->pageId, $this->currentPage->pathIds);
- $this->hasChildren = $this->active && count($this->menuItem->children);
- ?>
- <li<?= ($this->active ? ' class="active"' : ' class="inactive"') ?>>
- <a href="<?= $this->pageUrl($this->menuItem) ?>">
- <span class="menuItemContent">
- <?= $this->menuItem->contents->name ?>
- </span>
- </a>
- <? if($this->hasChildren): ?>
- <ul>
- <?= $this->getHelper('partialLoop')
- ->setObjectKey('menuItem')
- ->refVars('currentPage')
- ->partialLoop('_partials/widget/menu/main/item-3.phtml', $this->menuItem->children) ?>
- </ul>
- <? endif; ?>
- </li>
- Файл item-3.phtml
- <?
- $this->active = in_array($this->menuItem->pageId, $this->currentPage->pathIds);
- //$this->hasChildren = $this->active && count($this->menuItem->children);
- ?>
- <li<?= ($this->active ? ' class="active"' : ' class="inactive"') ?>>
- <a href="<?= $this->pageUrl($this->menuItem) ?>">
- <span class="menuItemContent">
- <?= $this->menuItem->contents->name ?>
- </span>
- </a>
- </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement