PHP code example of kregel / menu

1. Go to this page and download the library: Download kregel/menu library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kregel / menu example snippets


  'providers' => [
    ...,
    Kregel\Menu\MenuServiceProvider::class,
    ...,
  ]
 
 php artisan vendor:publish --provider="Kregel\Menu\MenuServiceProvider"
 

@

class MyFramework extends Kregel\Menu\Interfaces\AbstractMenu{
    public function add(Array $options)
    {
		// This will add each actual menu item to the menu variable
    }
    public function addDropdown($dropdown_name, $elements)
    {
		// This will build a dropdown ($elements should be an arary 
    }
    public function devour()
    {
		// Should return the menu item
    }
    public function buildMenu($menu)
    {
		// This should build the actual menu. For the config file I have
		// And you would call it like 
		// $menu->using('myframework')->buildMenu(['Home'=>'/']->devour()
    }
    public function config()
    {
    	// This would be how you handle your framework pulling form the config file.
    }
}