Skip to content

Nette Framework component for simple building of navigation (used TwitterBootstrap)

Notifications You must be signed in to change notification settings

flame-org/NavbarBuilder-Component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#NavbarBuilder-Component Build Status

About

Nette Framework component for simple building of navigation (used TwitterBootstrap)

Installation

Preferred way of installation is using Composer. Add the following dependency to your composer.json file and you're ready to go.

{
	"require": {
		"flame/navbarbuilder-component": "@dev"
	}
}

Usage

###In config.neon

factories:
	navbarBuilderControl:
        implement: \Flame\Components\NavbarBuilder\INavbarBuilderControlFactory
	...

###In base presenter

	/**
	 * @autowire
	 * @var \Flame\Components\NavbarBuilder\INavbarBuilderControlFactory
	 */
	protected $navbarBuilderControlFactory;

	/**
	 * @return \Flame\Components\NavbarBuilder\NavbarBuilderControl
	 */
	protected function createComponentNavbarBuilder()
	{
		$control = $this->navbarBuilderControlFactory->create();
		$control->setTitle('Dashboard', 'Dashboard:');

		$navbar = $control->getNavbarControl();
		$navbar->addItem('Posts', 'Post:');
		$navbar->addItem('List', 'Post:', 'Posts');
		$navbar->addItem('Import', 'Import:', 'Posts', true);
		$navbar->addItem('Comments', 'Comment:', 'Posts');

		$navbar->addItem('Newsreel', 'Newsreel:');
		$navbar->addItem('Images', 'Image:');

		$userbar = $control->getUserbarControl();
		$userbar->addItem('Account settings', 'User:edit');
		$userbar->addItem('Password edit', 'User:password');
		$userbar->setUserName($this->getUser()->getIdentity());

		return $control;
	}

###In template (e.g. @layout.latte)

{control navbarBuilder}

About

Nette Framework component for simple building of navigation (used TwitterBootstrap)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages