PHP code example of hwl / thinkphp-controllers-to-menu
1. Go to this page and download the library: Download hwl/thinkphp-controllers-to-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/ */
hwl / thinkphp-controllers-to-menu example snippets
//加入命名空间
use Hwl\ThinkphpControllersToMenu\ControllersToMenu;
$controllerFolderPath = __DIR__ . '/Controller';
//初始化并赋值上路径
$ctm = new ControllersToMenu($controllerFolderPath);
//获取菜单
$menu = $ctm->getMenu();