定制 bag/admin-panel-skeleton 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bag/admin-panel-skeleton

Composer 安装命令:

composer require bag/admin-panel-skeleton

包简介

Admin panel skeleton.

README 文档

README

A admin panel skeleton template. Comes with 4 built-in menus and javascript to handle opening and closing of menus.

Getting Started

Using Composer

$ composer require bag/admin-panel-skeleton

Cloning the Repo

To get started clone this repo somewhere in your project.

$ git clone https://github.com/pudge330/AdminPanelSkeleton.git

Customizing the CSS

AdminSkeleton uses SASS, to customize the look and feel just override any of the settings found in css/src/_setup.scss and include the main.scss file found in the same directory.

// file: admin-skeleton.scss

// Make the header background color white
$skeleton-color-headerBackground: #fff;
// Make the menu toggles semi-transparent black
$skeleton-color-headerMenuActionFocusBackground: rgba(0, 0, 0, 0.2);

@import 'path-to-adminskeleton/css/src/main.scss';

Then build the final css.

$ sass admin-skeleton.scss:admin-skeleton.css

Setting up Your HTML

Include the skeleton's CSS file or include it in your build.

<link href="/adminskeleton/css/main.min.scss" type="text/css" rel="stylesheet">

Include the javascript.

<script src="/adminskeleton/js/vendor/bglib.min.js"></script>
<script src="/adminskeleton/js/skeleton.min.js"></script>

AdminSkeleton also includes require js copies of the javascript skeleton-requirejs.js and skeleton-requirejs.min.js

I plan to bundle a custom build of bglib into it to make it a single javascript file.

Rendering in PHP

If you installed the admin panel skeleton via Composer you will just need to call the static render method on the AdminPanelSkeleton class.

use BAG\AdminPanelSkeleton\AdminPanelSkeleton;
$data = [
	// AdminSkeleton's configuration options
];
echo AdminPanelSkeleton::render($data);

If you installed the admin panel by either downloading a zip file or cloning the repo you need to render the php/skeleton.html.php template file manually or include the class file manually. You will also need to have a $data variable set in the current context with an associative array containing the templates configuration options.

/* Include the template directly */
$data = [
	// AdminSkeleton's configuration options
];
include 'path-to-adminskeleton/php/skeleton.html.php';

/* Include the class and use the built in render method */
require_once 'path-to-adminskeleton/src/AdminPanelSkeleton.php';
use BAG\AdminPanelSkeleton\AdminPanelSkeleton;
$data = [
	// AdminSkeleton's configuration options
];
echo AdminPanelSkeleton::render($data);

If the $data variable conflicts with one in your project you can wrap everything up in a function.

function renderAdminSkeleton($data) {
	include 'path-to-adminskeleton/php/skeleton.html.php';	
}
renderAdminSkeleton([
	// AdminSkeleton's configuration options
]);

// or as a closure
$renderAdminSkeleton = function($data) {
	include 'path-to-adminskeleton/php/skeleton.html.php';	
};
$renderAdminSkeleton([
	// AdminSkeleton's configuration options
]);

Template Configuration Options

Name Type Description
title String Page header title
version String System version string/HTML, bottom of main menu
mainMenu Array * An array representing a menu
headerMenu Array * An array representing a menu
memberLabel String A label for the header's dropdown menu, usually a member
memberImage String A image for the header's dropdown menu, usually a member photo or avatar
lockIcon Bool Whether or not to show the lock icon when the main menu doesn't exists, useful for login pages
hideEmptyHeader Bool Whether or not to show output header if empty when true
mainMenuState Bool Where or not the main page menu is open (true) or closed (false)
appMenuState Bool Where or not the app page menu is open (true) or closed (false)
headerMenuState Bool Where or not the header page menu is open (true) or closed (false)
sideMenuState Bool Where or not the header page menu is open (true) or closed (false)
mainMenuIcon Bool Main menu svg icon
mainMenuLockIcon Bool Main menu lock svg icon
appMenuIcon Bool App menu svg icon
headerMenuIcon Bool Header menu svg icon
sideMenuIcon Bool Side menu svg icon
content Array + Array containing content for various parts of the page

* Menus

  • name - the menu name
  • links - the menu links
    • text
    • url
    • urlNewWindow
    • icon
    • image
    • active
    • specialContent
    • toggle
    • links
  • toggleIcon - svg toggle icon

+ Content

  • page
  • header
  • headerMenu
  • mainMenu
  • sideMenu
  • appMenu
  • topToolbar
  • bottomToolbar

Sass Variable Reference

$skeleton-breakpoint-sm: 38em !default;
$skeleton-breakpoint-md: 46em !default;
$skeleton-headerSmHeight: 40px !default;
$skeleton-headerMdHeight: 50px !default;
$skeleton-pageMenuTiming: 0.4s !default;
$skeleton-color-headerBackground: #00AAE4 !default;
$skeleton-color-headerColor: #fff !default;
$skeleton-color-headerMenuActionColor: $skeleton-color-headerColor !default;
$skeleton-color-headerMenuActionFocusColor: null !default;
$skeleton-color-headerMenuActionFocusBackground: rgba(255, 255, 255, 0.3) !default;
$skeleton-color-headerMemberColor: $skeleton-color-headerColor !default; //--unused
$skeleton-color-headerMemberFocusColor: null !default; //--unused
$skeleton-color-headerBrandingColor: null !default;
$skeleton-color-headerLogoutHover: #FFCDD2 !default;
$skeleton-color-pageBackground: #fff !default;
$skeleton-color-pageColor: #222 !default;
//--fonts
$skeleton-font-base: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif !default;
$skeleton-font-heading:  "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif !default;
$skeleton-font-nav: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif !default;
$skeleton-font-map: (
	base: $skeleton-font-base
	,heading: $skeleton-font-heading
	,nav: $skeleton-font-nav
);

$skeleton-widget-adminNav-menuLinkColor: #000 !default;
$skeleton-widget-adminNav-menuLinkBackground: null !default;
$skeleton-widget-adminNav-menuLinkFocusColor: null !default;
$skeleton-widget-adminNav-menuLinkFocusBackground: #ccc !default;
$skeleton-widget-adminNav-menuLinkFocusBorder: #aaa !default;

bag/admin-panel-skeleton 适用场景与选型建议

bag/admin-panel-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 66 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「admin」 「Skeleton」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 bag/admin-panel-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bag/admin-panel-skeleton 我们能提供哪些服务?
定制开发 / 二次开发

基于 bag/admin-panel-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-23