PHP code example of flexpress / component-menu

1. Go to this page and download the library: Download flexpress/component-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/ */

    

flexpress / component-menu example snippets


$pimple["menu"] = function() {
  return new PostTypeMenu();
};

$defaults = array(

  'starting_level' => 1,
  'post_type' => 'page',
  'post_id' => $GLOBALS['post']->ID,
  'sudo_items' => array(),
  'force_current' => null,
  "recurse" => true

);

$pimple["menu"]->output($defaults);

$args['sudo_items'] = array(
  
  123 => array(
    "id" => -1,
    "title" => "Some random link",
    "link" => "/some/random/link",
  )

);