2017 © Pedro Peláez
 

library themosis-menu

A package to make working with menus easier.

image

keltiecochrane/themosis-menu

A package to make working with menus easier.

  • Thursday, May 25, 2017
  • by keltiecochrane
  • Repository
  • 1 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Themosis Cache

A package to make working with menus easier. Requires keltiecochrane/themosis-illuminate and keltiecochrane/themosis-cache to be setup for collections and caching. Will build menus from source and cache them "forever", will clear the menu from cache if it's updated/deleted., (*1)

Install

Install through composer: - composer require keltiecochrane/themosis-menu, (*2)

Register the service provider in your theme/resources/config/providers.php file: - KeltieCochrane\Menu\MenuServiceProvider::class,, (*3)

Optionally register the alias in your theme/resources/config/theme.php file: - 'Menu' => KeltieCochrane\Menu\MenuFacade::class,, (*4)

Examples

  $menu = Menu::getByLocation('header-nav');
  $menu->name; // The menu's name
  $menu->each(function ($item) {
    $item->children; // The menu items children
    $item->descendants; // A collection of IDs for all this items descendants
    $item->active; // Boolean indicating whether this item is the current page/post/etc.
    $item->active_descendant // Boolean indicating whether a descendant is active

    // Plus all the usual WP_Post fields
  });

See the Laravel docs for more info., (*5)

Helpers

The following (additional) helpers are available: -, (*6)

  • getMenuById(int $menuId, int $activePostId = null)
  • getMenuByLocation(string $location, int $activePostId = null)

To Do

  • Testing

Support

This plugin is provided as is, though we'll endeavour to help where we can., (*7)

Contributing

Any contributions would be encouraged and much appreciated, you can contribute by: -, (*8)

  • Reporting bugs
  • Suggesting features
  • Sending pull requests

The Versions

25/05 2017

dev-master

9999999-dev

A package to make working with menus easier.

  Sources   Download

GPL-3.0

The Requires

 

themosis

25/05 2017
25/05 2017

dev-develop

dev-develop

A package to make working with menus easier.

  Sources   Download

GPL-3.0

The Requires

 

themosis

15/05 2017