Download the PHP package coreplex/navigator without Composer

On this page you can find all versions of the php package coreplex/navigator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package navigator

Navigator Build Status Latest Stable Version License

A PHP 5.4+ package to create navigation menus, and handle active and permissions.

Installation

This package requires PHP 5.4+, and includes a Laravel 5 Service Provider and Facade.

We recommend installing the package through composer. You can either call composer require coreplex/navigator in your command line, or add the following to your composer.json and then run either composer install or composer update to download the package.

Laravel 5 Integration

To use the package with Laravel 5 firstly add the service providers to the list in app/config/app.php.

Then to run php artisan vendor:publish in your command line to publish the config.

Registering Menus

To register a menu you add it into the menus array in the navigator config file. To register a menu you set a key to retrieve a the menu by as the key, and the class to build the menu as the value.

By default the menu class will user a method called design, but if you want to set the method name your self just separate the class and method name with an @ symbol.

To see how to create menus check the creating menus section below.

Retrieving Menus

Once you've registered a menu to retrieve it use the get method.

Creating Menus

To create a menu you need to return a nested array of menu items. Each item is made up of a url, any nested menu items, and then any attributes wish the item to have. As an example check the code below.

This will add two items to then menu; one for the home page and the other is the about page. The about page also has nested items so we can display them in a drop down when rendering.

The url isn't required, but is used to check if the item is the active item.

You can add any attributes you wish to the menu items. In the example a title attribute has been set, but we could also add an icon, class etc. here and then access it on the item when it is rendered.

Filters

Occasionally you may need to only show a menu item if a condition is met; to do this with use filters.

To register a filter add it to the filters array in the config file by setting a unique key as a the key and a class to use as the value.

The filter classes by default use a method called filter but again if you want to specify a method then separate the class and method with an @ symbol.

To call a filter no a menu item add a filter attribute to the menu item.

The method on the filter class will then be passed the item so you can do any checking you need to.

Rendering Menus

To render a menu you have a couple of options. Either you can set a template to render it to, or you can access the menus properties.

Rendering With a Template

To render with a template simply call the render method on the menu. This will either use the default view set in the config file, or you can pass the path to the template to use to the render method.

This package comes with a default template as an example.

Rendering From the Menu

To access the items in a menu use the items method or just pass the menu through a iterator.

Then once you've got a menu item you can can check if it is the active menu item by calling the isActive method.

Then you can access any properties set on the item by just accessing the key on the item object. For example if you have set a url for the item then I could do the following.


All versions of navigator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
coreplex/core Version ~0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coreplex/navigator contains the following files

Loading the files please wait ....