承接 drago-ex/project-backend-ui 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drago-ex/project-backend-ui

最新稳定版本:v2.0.12

Composer 安装命令:

composer require drago-ex/project-backend-ui

包简介

Integration of a basic template for administration.

README 文档

README

Integration of a basic template for administration.

License: MIT PHP version Coding Style

Requirements

  • PHP >= 8.3
  • Nette Framework
  • Composer
  • Bootstrap
  • Naja
  • Node.js
  • Drago Project core packages

Installation

composer require drago-ex/project-backend-ui

Project files

File copying is handled automatically by drago-ex/project-tools, which must be installed in your project. Without it, copy the files manually according to the copy section in this package's composer.json. To skip this package, set "skip": true under extra.drago-tools.packages.<package-name> in your root composer.json.

Warning: This package uses the replace section, which means some files will be overwritten if they already exist. Avoid manual edits to those files; use the skip option if you need to manage them yourself.

Install npm

npm install sidebar-skeleton-compostrap sidebar-menu-compostrap dashboard-skeleton-compostrap perfect-scrollbar

This package is based on Dashboard Skeleton.

Use admin-theme.js

The copied assets/admin.js file already initializes the admin theme:

import { initAdminTheme } from "./core/admin-theme.js";

document.addEventListener("DOMContentLoaded", () => {
	initAdminTheme();
});

Creating a Menu

The menu is typically created in a base presenter for the administration (e.g., BackendPresenter).

private function getSidebarMenuStructure(): array
{
	$builder = new SidebarBuilder;

	// Sections are optional and serve as titles/separators
	$builder->addSection('System')
		// Simple link with icon
		->addItem('Dashboard', 'Admin:')
		->setIcon('fa-solid fa-mug-hot bell')

		// Complex item with permissions and submenu
		->addItem('Permissions', 'Permission:*')
		->setIcon('fa-solid fa-gear bell')
		->setAllowAny('Backend:Permission', 'roles-read', 'users-read')
		->addSubItem('Roles', 'Permission:roles', ['Backend:Permission', 'roles-read'])
		->addSubItem('Users', 'Permission:users', ['Backend:Permission', 'users-read']);

	return $builder->build();
}

Then pass it to the template in beforeRender:

protected function beforeRender(): void
{
	parent::beforeRender();
	$this->template->sidebarMenu = $this->getSidebarMenuStructure();
}

Menu Composition Guide

  • addSection(string $title) - (Optional) Creates a new group of items with a visible header (title). Use this when you want to visually separate different parts of the menu. If skipped, items will be grouped together without a title.

  • addItem(string $title, string $link) - Adds a primary link to the sidebar. If you only use this method, it renders as a direct link. If followed by addSubItem, it automatically becomes a dropdown toggle for the submenu.

  • setIcon(string $icon) - Attaches a FontAwesome icon (e.g., fa-solid fa-user) to the last added primary item.

  • addSubItem(string $title, string $link, ?array $allow = null) - Adds a child link to the last added primary item, automatically turning it into a submenu.

Integration with project-permission

If you are using the project-permission package, the menu automatically handles visibility based on user privileges.

  • setAllowAny(resource, ...privileges) - The main item is displayed if the user has at least one of the specified privileges for the given resource.

  • addSubItem(..., [resource, privilege]) - The sub-item is displayed only if the user has the exact privilege for the given resource.

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Latte

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固