The community, our concern

Some time ago, we decided it was time to upgrade some internal tools we are using on our daily-basis to automate certain tasks, to build up some dashboards and to make some cool things. So coinciding with the release of the 2nd version of the Twitter’s Bootstrap toolkit, we decided to build some Zend_Form decorators based on the Twitter’s toolkit and open it in our Github account.

The result

Emagister / zend-form-decorators-bootstrap is a simple library that wraps Twitter’s Bootstrap toolkit into some Zend_Form decorators, providing with a simple way of generating good-looking HTML forms easily. Here is an example

<?php

class My_Bootstrap_Form extends Twitter_Bootstrap_Form_Inline
{
    public function init()
    {
        $this->setIsArray(true);
        $this->setElementsBelongTo('bootstrap');

        $this->_addClassNames('well');

        $this->addElement('text', array(
            'placeholder'   => 'E-mail',
            'prepend'       => '@',
            'class'         => 'focused'
        ));

        $this->addElement('password', array(
            'placeholder' => 'Password'
        ));

        $this->addElement('button', 'submit', array(
            'label'         => 'Login',
            'type'          => 'submit',
            'buttonType'    => 'success',
            'icon'          => 'ok',
            'escape'        => false
        ));
    }
}

In addition, we have updated the library to be able to be installed through Composer. All you have to do is to add these lines to your composer.json file

{
    "require": {
        "emagister/zend-form-decorators-bootstrap": "dev-master"
    }
}

Currently, we have over 65 watchers and 16 forks with some active contributors. So, if you want to contribute please feel free to send us your Pull Request.

 

2 Comments

 

  1. Pingback : how to use the twitter bootstrap framework in a zend framework 1 application? - PHP Solutions - Developers Q & A

  2. 15/02/2014  11:43 AM by D'amis Reply

    Has this library Been tested with bootstrap 3?

Leave a reply

 

Your email address will not be published.