PHP code example of nattreid / menu
1. Go to this page and download the library: Download nattreid/menu library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nattreid / menu example snippets
/** @var \NAttreid\Menu\IMenuFactory @inject */
public $menuFactory;
function createComponentMenu() {
$menu = $this->menuFactory->create();
$link = $menu->addLink('test', 'Test:test');
$group = $link->addGroup('group');
// ... atd
return $menu;
}
protected function createComponentBreadcrumb() {
$breadcrumb = $this['menu']->getBreadcrumb();
return $breadcrumb;
}