xin/menu

There is no license information available for the latest version (v1.0.2) of this package.

v1.0.2 2024-12-06 10:27 UTC

This package is auto-updated.

Last update: 2024-12-09 14:04:03 UTC


README

介绍

菜单管理器

安装教程

composer require xin/menu

使用教程

<?php

use Xin\Menu\MenuManager;

require_once './vendor/autoload.php';

$manager = new MenuManager([
	'defaults' => [
		'menu' => 'admin',
	],

	'menus' => [
		'admin' => [
			'driver' => 'database',
			//'driver'        => 'model',
			'model'  => AdminMenu::class,
			'loader' => [
				'base_path'   => 'menus.php',
				'target_path' => 'target.php',
			],
		],
	],
]);
$menu = $manager->menu();
//$loader->appendFile('./menus.php', 'shop');;
//var_dump($loader->toList());
//var_dump($loader->export("./target.php"));
var_dump($menu->generate("index/index"));