Download the PHP package bhoeting/navigation-builder without Composer
On this page you can find all versions of the php package bhoeting/navigation-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bhoeting/navigation-builder
More information about bhoeting/navigation-builder
Files in bhoeting/navigation-builder
Package navigation-builder
Short Description A Blade helper to easily create Navigation HTML.
License
Informations about the package navigation-builder
This project will not be updated for Laravel 5.
NavigationBuilder
A navigation HTML generator for Laravel.
Installation
Run composer install
Add the service provider to the providers
array in app/config/app.php
Then add the facade to the aliases
array
Usage
Basic
Will generate:
By default, a Bootstrap template is used to generate the HTML. See Advanced on how you can create your own templates.
Also note that the about
item has an a class of active
. This is because the current URL is the same as the about item's link.
Items are also active when the current URL matches a pattern of the item's link. For instance, http://localhost:8000/about/who-we-are
will also make the about
item active.
The display text and URL for each item are based on the strings provided in the array. You can specify your own like so:
Output:
You can also associate a Font Awesome Icon to be displayed next to the Item's text.
Will output:
Advanced
You can easily re-use and configure Navigations by extending the provided AbstractNavigaiton
and specify your own templates, active class, and Items.
Create the templates:
app/views/navigation/item.blade.php
app/views/navigation/container.blade.php
Then in your view:
You can also store Navigation items in the database. First, create a migration like the one below:
Now in your extension of AbstractNavigation