コード例 #1
0
 /**
  * @depends     testInitBreadcrumbs
  * @param       Breadcrumbs
  * @return      void
  */
 public function testRenderReverseWithOrderedListTagAndAttributes(Breadcrumbs $breadcrumbs)
 {
     $breadcrumbsHelper = new BreadcrumbsHelper($breadcrumbs);
     $breadcrumbsHelper->setReverse(true);
     $breadcrumbsHelper->setTag('ol');
     $breadcrumbsHelper->setOptions(array('id' => 'breadcrumb', 'class' => 'breadcrumbs'));
     $string = '<ol id="breadcrumb" class="breadcrumbs"><li>address</li><li><a href="/profile/">profile</a></li><li><a href="/home/">home</a></li></ol>';
     $this->assertEquals($string, $breadcrumbsHelper->render());
 }
コード例 #2
0
    } else {
        echo $breadcrumb->getTitle();
    }
    echo '&nbsp;';
}
echo '<br/>' . PHP_EOL;
use Naucon\Breadcrumbs\Helper\BreadcrumbsHelper;
$breadcrumbsHelper = new BreadcrumbsHelper($breadcrumbs);
echo $breadcrumbsHelper->render();
echo '<br/>' . PHP_EOL;
// with separator
$breadcrumbsHelper->setSeparator(' / ');
echo $breadcrumbsHelper->render();
echo '<br/>' . PHP_EOL;
// with span tag and separator
$breadcrumbsHelper->setTag('span');
$breadcrumbsHelper->setSeparator(' / ');
echo $breadcrumbsHelper->render();
echo '<br/>' . PHP_EOL;
// with div tag and separator
$breadcrumbsHelper->setTag('div');
$breadcrumbsHelper->setSeparator(' / ');
echo $breadcrumbsHelper->render();
echo '<br/>' . PHP_EOL;
$breadcrumbsHelper->setSeparator();
// with ul tag
$breadcrumbsHelper->setTag('ul');
$breadcrumbsHelper->setOptions(array('id' => 'breadcrumb', 'class' => 'breadcrumbs'));
echo $breadcrumbsHelper->render();
echo '<br/>' . PHP_EOL;
$breadcrumbsHelper->setTag('ol');