Download the PHP package dotkernel/dot-navigation without Composer

On this page you can find all versions of the php package dotkernel/dot-navigation. 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 dot-navigation

dot-navigation

OSS Lifecycle PHP from Packagist (specify version)

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov

SymfonyInsight

Allows you to easily define and parse menus inside templates, configuration based approach.

Installation

Run

composer require dotkernel/dot-navigation

Merge ConfigProvider to your application's configuration.

The package uses dot-helpers package, please merge dot-helpers ConfigProvider to your application's configuration also, if it's not merged already!

Register NavigationMiddleware in your middleware pipe between the routing and the dispatching middleware.

Configuration

Locate dot-navigation's distributable config file vendor/dotkernel/dot-navigation/config/autoload/navigation.global.php.dist and duplicate it in your project as config/autoload/navigation.global.php

Components

A menu, or navigation container, is a class implementing the \RecursiveIterator interface. It has a hierarchical structure, with nodes called pages(see the Page class) that may have children. It is basically a tree

A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu. The children of this node are Page instances that defines each navigation item.

A page has a reference to its parent, and can have options and attributes. There are no limitation on what is accepted as options or attributes.

Options can be any piece of information that describes a page. Some predefined options exists, in order for the navigation module to work seamlessly with other dot modules.

Attributes are key value pairs that defines the menu item. They are usually inserted as html attributes when parsing the menu, but of course, this is implementation specific.

A NavigationService class, is the service that handles all defined menu container. It can fetch the container from its provider, check if a page is active or not and get the page's generated URI.

Container providers

Each menu can be created from different sources. The responsibility of creating a menu container from the source falls on a container provider.

Each provider must implement the interface ProviderInterface and be registered in the ProviderPluginManager.

We offer just one provider for now, ArrayProvider, that is able to fetch and create a menu container from a php array that is defined in the configuration file.

NavigationRenderer

Used to render the navigation container in a displayable format. It can render a simple HTML ul list or use a partial template, to render the menu in a template engine.

The partial method is usually the more flexible one, custom rules can be defined and checked in the template.

If you are using twig, there is already a twig extension provided in package dot-twigrenderer, that you can use to easily parse the menus inside your templates

When using the partial method, the template will receive as parameters the container, the navigation service and any extra parameters set by the developer.

Navigation containers are referred, when parsed, by their name, as defined in the configuration file.

Required page options and attributes

The following are options that each page should define in the configuration


All versions of dot-navigation with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
dotkernel/dot-authorization Version ^3.4.1
dotkernel/dot-helpers Version ^3.5.1
laminas/laminas-escaper Version ^2.13.0
laminas/laminas-servicemanager Version ^3.22.1
mezzio/mezzio-template Version ^2.9.0
psr/http-message Version ^1.0 || ^2.0
psr/http-server-middleware Version ^1.0.2
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 dotkernel/dot-navigation contains the following files

Loading the files please wait ....