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
- 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
- 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.
- 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:
- 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)
- 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:
-
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.
-
Specific Bootstrap type QControls to draw particular things on the screen. Examples include:
- Carousel
- Navbar
- Menu button
- Alert
- Accordion
- 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
- 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 qcubed/plugin_bootstrap 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Selectize Theme for Bootstrap 4
QCubed-4 application starter template
Installer plugin for the QCubed-4 framework.
QCubed wrappers for Twitter Bootstrap. Specifically for QCubed v4 and above.
统计信息
- 总下载量: 173
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-16