定制 qcubed/plugin_bootstrap 二次开发

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

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

qcubed/plugin_bootstrap

Composer 安装命令:

composer require qcubed/plugin_bootstrap

包简介

QCubed wrappers for Twitter Bootstrap.

README 文档

README

QCubed plugin to simplify the integration of Twitter Bootstrap

Installation

  1. Install both the plugin and twitter bootstrap using Composer. Execute the following on the command line from your main install directory:
	composer require qcubed/plugin_bootstrap
	composer require twbs/bootstrap
  1. Next, you might want to set up some configuration settings in your configuration.inc.php file.

BOOTSTRAP_CSS

The default setting for this file is:

	define ('__BOOTSTRAP_CSS__', __VENDOR_ASSETS__. '/twbs/bootstrap/dist/css/bootstrap.min.css');

If you are compiling your own custom version of the bootstrap css file, simply set that define to point to your own version.

  1. Point the base class to Bootstrap classes so that they add their functionality.

In your project/includes/controls/QControl.class.php file, have your QControl inherit from the base class. For example, you should change the first line to:

abstract class QControl extends QCubed\Plugin\Bootstrap\Control {

BOOTSTRAP_JS

The default mechanism included in this plugin only loads the bootstrap.js file on forms using the plugin widgets that need it. If you are hand-coding some bootstrap forms that also need bootstrap.js, you should do both of the following to avoid multiple bootstrap.js files being loaded:

  1. Define BOOTSTRAP_JS in your configuration.inc.php file and point it to your desired bootstrap js file as so:
	define ('__BOOTSTRAP_JS__', __VENDOR_ASSETS__ . '/twbs/bootstrap/dist/js/bootstrap.js'); (or bootstrap.min.js if you prefer)
  1. Either add this file to your footer.inc.php file like this:
	<script type="text/javascript" src="<?php echo(__BOOTSTRAP_JS__); ?>"></script>

or add it to the list of auto-loaded javascript forms in your QForm.class.php file like this:

	protected function GetFormJavaScripts() {
		$scripts = parent::GetFormJavaScripts();
		$scripts[] = __BOOTSTRAP_JS__;
		return $scripts;
	}

Usage

See the examples pages for details. The main functionality includes:

  1. Using RenderFormGroup instead of RenderWithName to draw form objects in the Bootstrap way. The Bootstrap Control class exposes a number of utility classes to add Bootstrap class to the object, the label, the wrapper, and even some internal wrappers in special situations.

  2. Specific Bootstrap type QControls to draw particular things on the screen. Examples include:

  • Carousel
  • Navbar
  • Menu button
  • Alert
  • Accordion
  1. Extensions of base QCubed controls with additional Bootstrap functionality. Includes:
  • Checkbox to draw checkboxes the bootstrap way with the label wrapping the checkbox
  • TextBox to add the ability to draw it as an inline-group with another object
  1. Defines that give you easy access to all the various Bootstrap class names via PHP constants. Those are located in the Bootstrap.php file.

qcubed/plugin_bootstrap 适用场景与选型建议

qcubed/plugin_bootstrap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 173 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 02 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 qcubed/plugin_bootstrap 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 9
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-16