Git Product home page Git Product logo

ise-module-bootstrap's Introduction

Twitter Bootstrap module for Zend Framework 2+

Introduction

This module intends to integrate Twitter Bootstrap with Zend Framework 2 and offers general view helpers, navigation view helpers and form view helpers.

Requirements

This module uses AssetManager, and by default, comes set up to use YuiCompressor to compress assets.

Installation

Installation of this module uses composer.

php composer.phar require ise/ise-module-bootstrap

Then add the following modules into your Zend Framework configuration.

  • AssetManager
  • Ise\Bootstrap

Usage

Form View Helpers

The following form view helpers are registered by default, which override those provided by Zend Framework, and can be used in their place. All elements will have the appropriate bootstrap style classes added to them.

An entire form can easily be rendered as follows:

/**
 * Where $form implements Zend\Form\FormInterface
 */
echo $this->form($form);

View Helpers

The bootstrap CSS/JS and meta tags are added by usage of a DispatchListener. The following view helpers are registered by default.

Note: The Time plugin uses jQuery Timeago to display time as "2 minutes ago" for instance.

Navigation View Helpers

The following navigation view helpers are registered by default.

You can use the navbar helper as follows:

/**
 * Where $container is a valid navigation container name, such as
 * 'default_navigation', if using the default ZF2 navigation factory.
 *
 * To have some of the links floated to the right (a login button for instance),
 * you can pass in the 'rightMenu' option to point to another navigation
 * container instance.
 */
echo $this->navigation($container)->navbar()->render(null, [
    'brand'     => [
        'label' => 'Your Brand Name Here',
        'route' => 'home',
        'icon'  => 'th-large', // Or any other icon name that would be prefixed glyphicon-*
    ],
    'inverse'   => true,
    'fixed'     => 'top',
    'rightMenu' => $anotherContainer,
]);

Credits

Made by Internalsystemerror Limited, and released under the BSD 3-Clause License

ise-module-bootstrap's People

Contributors

internalsystemerror avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.