lotus/navmenu

A lightweight implementation of navigation menu builder for PHP

v1.1.2 2017-06-02 11:18 UTC

This package is not auto-updated.

Last update: 2024-05-06 13:56:13 UTC


README

This is a package for simply creating Navigation Menu, breadcumb and sitemap in PHP, Codeigniter and Laravel 5.

Introduction

Simply use the Menu facade in the place of the Nav Menu facade when you want to generate a Navigation Menu.

Add via composer

composer require lotus/navmenu

Menu is a php class which auto build navigation menu.

First Input the menu array and navbar css class.

$type = 'user';
Menu::setMenuArray ( $navbarArray,[ 'class' => 'nav nav-bar' ], $type );

To place menu at your page, use render method at your header page.

echo Menu::render ();

Get Breadcumb

echo Menu::renderBreadcumb ();

Get Active menu array

$lavel = 0;
echo Menu::getActiveMenu($lavel);

This one can generate sitemap also. site map using this class library.

Generate Sitemap in Sitemap page use,

Menu::renderSitemap( $type, 'Customer' ) ;

$menutype is either public or user.

Example menu input array

$navbarArray = [ 'home' => [ 'label' => 'Home', 'url' =>  ( '/Home' ), 'icon'=>'fa fa-home' ],
	    'View' => [ 'label' => 'View', 'url' => '',
			 'child' => [
				 'user_related' => [ 'label' => 'User Related', 'url' => '#'  ]
			]
		 ],
		'AboutUs' => [ 'label' => 'About Us', 'url' => '#' , 
			'child' => [ 'aboutus' => [ 'label' => 'About Us', 'url' =>  ( '/About-us' ) ],
				     'contactus' => [ 'label' => 'Contact Us', 'icon' => 'fa fa-envelope', 'url' =>  ( '/Contactus' ) ]
				 ] 
			],
		'usermenu' => [ 'label' => 'Login', 'icon' => 'fa fa-sign-in', 'url' => "#", 'atribute' => [ 'onClick' => "log_in();" ] ] 
	];