2017 © Pedro Peláez
 

library menus

Utility to generate a static array full of links

image

anekdotes/menus

Utility to generate a static array full of links

  • Thursday, November 10, 2016
  • by anekdotes
  • Repository
  • 2 Watchers
  • 0 Stars
  • 107 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Anekdotes Menus

Latest Stable Version Build Status codecov.io StyleCI License Total Downloads Codacy Badge, (*1)


Utility to generate an intelligent "range" of links based on the current page and total pages., (*2)

Installation

Install via composer in your project :, (*3)

composer require anekdotes/menus

Basic usage

Load the class, (*4)

  use Anekdotes\Menus\Menus;

Add menu using the class' method, (*5)

  Menus::addItem('test 1', '/test1', 'fa-potato');

You can also specify the level and position, (*6)

  Menus::addItem('test 1', '/test1', 'fa-potato', 1, 1);

You can also add a namespace, (*7)

  Menus::addItem('test 1', '/test1', 'fa-potato', 1, 1, 'potato');

Fetch all main menus, (*8)

  $items = Menus::main();

Or get all menus from a desired level and namespace, (*9)

  $items = Menus::get('potato', 1);

Advanced

addItem

Method to add an item to the menu's array, (*10)

  Menus::addItem($title, $url, $icon, $level, $position, $namespace);
  //$title the link title/name/text
  //$url the link url
  //$icon the link icon (font-awesome, ex: fa-times)
  //$level the link level (default: 1)
  //$position the link position (default: 0)
  //$namespace the link namespace (default: "")

removeItem

Method to remove an item from the menu's array, (*11)

  Menus::removeItem($level, $position);
  //$level link level
  //$position the link position

find

Method to find a specific item from the menu's array, (*12)

  Menus::find($level, $position);
  //$level link level
  //$position the link position

main

Method to get all level 1 item, (*13)

  Menus::main($sort);
  //$sort sorting either SORT_ASC or SORT_DESC (default: SORT_ASC)

clear

Method to clear all items from menu's array, (*14)

  Menus::clear();

get

Method to get all item from desired level and namespace, (*15)

  Menus::get($namespace, $level);
  //$namespace the link namespace (default: "")
  //$level the link level (default: 1)

The Versions

10/11 2016

dev-master

9999999-dev

Utility to generate a static array full of links

  Sources   Download

MIT

The Requires

 

The Development Requires

link menu menus links

10/11 2016

1.2.0

1.2.0.0

Utility to generate a static array full of links

  Sources   Download

MIT

The Requires

 

The Development Requires

link menu menus links

09/08 2016

1.1.0

1.1.0.0

Utility to generate a static array full of links

  Sources   Download

MIT

The Requires

 

The Development Requires

link menu menus links

09/08 2016

1.0.0

1.0.0.0

Utility to generate a static array full of links

  Sources   Download

MIT

The Requires

 

The Development Requires

link menu menus links