manuscle/sxbootstrap2

此包已被废弃且不再维护。未建议替代包。

基于 spoonx/SxBootstrap 的 ZF2 & TWBS 2.3.2 Twitter Bootstrap 模块

dev-master 2018-01-05 12:13 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:11:40 UTC


README

这是从 https://github.com/SpoonX/SxBootstrap 复制的 SxBootstrap

本仓库做出的更改

目前没有更改

SxBootstrap2

此版本重新审视了表单实现,现在比以往任何时候都更容易使用!

此模块提供视图助手,使与 Twitter Bootstrap 一起工作变得简单。此外,此模块还允许您使用 AssetManager 模块构建、缓存、修改和扩展 Twitter Bootstrap。

安装视图助手

如何安装?

将需求添加到您的 composer.json 文件中

./composer.phar require spoonx/sxbootstrap
# When asked for a version, type: "2.*"

安装 Font Awesome

如何安装?

  1. 将依赖添加到您的 composer.json 文件中

    ./composer.phar require fortawesome/font-awesome
    # When asked for a version, type: "3.*"
  2. 通过在 config/autoload/sxbootstrap.local.php 中添加以下内容启用 Font Awesome 的使用

    <?php
    return array(
        'twitter_bootstrap' => array(
            'use_font_awesome' => true,
        ),
    );

安装渲染器(推荐)

如何安装?

  1. 将依赖添加到您的 composer.less 文件中

    ./composer.phar require rwoverdijk/assetmanager twbs/bootstrap
    # When asked for a version, type: "1.*" for assetmanager and "2.*" for bootstrap.
  2. 在您的 application.config.php 配置文件中启用 AssetManagerSxBootstrap

  3. 安装 less...

    a) 通过 NPM/Node.js (推荐方法)

    1. Install npm/node.js. [Instructions](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) can be found here.
    2. To Install lessc, open up your command line, and navigate to your project (`cd /path/to/my/project`).
    3. Once you get there, run the following command: `npm install less .` (including the dot).
    

    b) 通过 lessphp(不推荐)

    **Add the requirement**
    
    ```bash
    ./composer.phar require leafo/lessphp
    # When asked for a version, type: "0.*"
    ```
    
    Then add the following config to your application's module.config.php:
    
    ```php
    'twitter_bootstrap' => array(
        'use_lessphp' => true,
    ),
    ```
    
  4. 配置过滤器以使其生效。(这仅适用于您使用 Node.js 且二进制文件不在 /usr/bin/node 中,或您的 Node.js 路径不是默认的,因此您已忽略我在步骤 3a 中的建议。)

  5. 查看 wiki 以获取示例和其他信息以开始使用。特别是关于 如何配置过滤器以使其生效(页面底部) 的部分。

好吧...为什么?

渲染器有很多优点。

功能

  • 简单而强大的表单
  • 新增 可选的 Font Awesome 集成
  • 新增 添加加载路径
  • 新增 添加自定义组件
  • 可定制(变量、组件、插件)
  • 与 AssetManager 兼容
  • 丰富的 ViewHelpers
  • 可扩展(从 bootstrap 上下文运行自己的 less 文件以共享混合和变量)
  • 经过 twitter bootstrap 2.3+ 的测试(较旧版本也可能适用)
  • 你可以选择使用 lessphp(不推荐)

使用方法

查看 vendor/spoonx/sxbootstrap/config 下的 config/sxbootstrap.local.php.dist 文件以获取配置选项和信息。同时,请查看wiki

问题 / 支持

如果你在使用此模块时遇到问题,这里有一些可能有用的资源。