User Tools

Site Tools


Table of Contents


The wayHome ViewHelper returns an array of items, from the current page up to the toplevel page.

This can be useful for example to:

  • display a breadcrumb menu
  • find out in which level you are
  • collapse the current menu in your navigation and display its children

→ Since BIGACE 3.0


  • $item - (required, Item|array)

The $item to fetch the way-home for, most often this will be the current menu.

  • $showHidden - (optional, boolean)

Whether hiddden files should be included in the way-home. This is useful if you want to display a breadcrumb where you leave-out hidden pages.


This example shows to load and display a simple breadcrumb menu for the current page.

$breadcrumbs = $this->wayHome($this->MENU, true);
$amount = count($breadcrumbs);
if($amount > 0)
    <ul id="breadcrumbs">
        $i = 0;
        foreach ($breadcrumbs as $id => $item) { 
	        echo '<li';
	        if($i == 0) echo ' class="first"';
	        if($i == $amount-1) echo ' class="last"';
	        echo '><a href="'.$this->link($item).'">'.$item->getName().'</a></li>';

See also

bigace/developer/viewhelper/wayhome.txt · Last modified: 2010/05/27 15:22 by bigace