Download the PHP package unstoppablecarl/navinator without Composer
On this page you can find all versions of the php package unstoppablecarl/navinator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download unstoppablecarl/navinator
More information about unstoppablecarl/navinator
Files in unstoppablecarl/navinator
Package navinator
Short Description A php package for fexibly managing navigation template data.
License MIT
Homepage https://github.com/unstoppablecarl/navinator
Informations about the package navinator
Navinator
Navinator is a php package for fexibly managing navigation data for views.
Navinator is a light weight navigation tree helper providing simple collection and node classes designed to allow you to generate navigation tree data without complication.
Installing
- Install Composer
-
Add
unstoppablecarl/navinator
to your project'scomposer.json
file: - Install/update
Look at the example files in examples/
to see all the cool things you can do with Navinator.
Design Goals
- Add nodes to a collection tree without complication
- Add nodes in any order, parents do not have to be added before children
- Nodes do not need to know anything about children or parents
- Use a simple directory-like path to describe the position of a node in the tree
- Act as a helper that could be used for any view
- Generate data ready to be used by a view requiring minimal logic and function calls
- Let the view handle the html
Node Path and Node Url
Each node has a directory-like path that describes where the node is in the tree. In most cases the url of the nav node will match the path. By default slashes are added to the path and set as the url.
Usage
- Create a collection
- Add nodes to the collection in any order
- Generate the data to be passed to your view.
The following example generates a simple navigation tree.
- my-favorite-sites
- google search
- maps
- gmail
- github
- gist
- google search
Views
The output template data can be rendered with a very simple view function.
A more extensive example of this simple view is available in examples/simple-view/index.php
License
MIT