PHPackages                             cruiser13/zend1-bootstrap3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. cruiser13/zend1-bootstrap3

ActiveLibrary[Templating &amp; Views](/categories/templating)

cruiser13/zend1-bootstrap3
==========================

Twitter Bootstrap v.3 Forms for Zend Framework v.1 extended

1.0.9.1(6y ago)11222MITPHPPHP &gt;=5.3.0

Since Jun 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Cruiser13/zend1-bootstrap3)[ Packagist](https://packagist.org/packages/cruiser13/zend1-bootstrap3)[ RSS](/packages/cruiser13-zend1-bootstrap3/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (6)Versions (12)Used By (0)

\#Twitter Bootstrap 3 Form for Zend Framework 1 extended

This library was originally created by @zfbase and forked by @wendrowycz This is an extended version, adding an HTML element, inline form option with labels, form-group class option and more.

Form types
----------

[](#form-types)

The library supports all Bootstrap 3 form types.

### One PHP code

[](#one-php-code)

```
class Application_Form_Example extends Twitter_Bootstrap3_Form_*
{
    public function init()
    {
        $email = new Twitter_Bootstrap3_Form_Element_Email('email');
        $email->setLabel('Email')->setAttrib('placeholder', 'Email');
		$email->setRequired(true);

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password')->setAttrib('placeholder', 'Password');

        $checkbox = new Zend_Form_Element_Checkbox('checkbox');
        $checkbox->setLabel('Remember me');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Sign in');

        $this->addElements(array(
            $email,
            $password,
            $checkbox,
            $submit

        ));
    }
}
```

#### OR

[](#or)

```
class Application_Form_Example extends Twitter_Bootstrap3_Form_*
{
    public function init()
    {
        $this->addElement('email', 'email', array(
            'label' => 'Email',
            'placeholder' => 'Email',
			'required' => true,
        ));

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

        $this->addElement('checkbox', 'checkbox', array(
            'label' => 'Remember me',
        ));

        $this->addElement('submit', 'submit', array(
            'label' => 'Sign in',
        ));
    }
}
```

### HTML generated for vertical form

[](#html-generated-for-vertical-form)

The form must be inherited from class `Twitter_Bootstrap3_Form_Vertical`.

```

        Email

        Password

            Remember me

```

### HTML generated for horizontal form

[](#html-generated-for-horizontal-form)

The form must be inherited from class `Twitter_Bootstrap3_Form_Horizontal`.

```

        Email

        Password

                    Remember me

```

### HTML generated for inline form

[](#html-generated-for-inline-form)

The form must be inherited from class `Twitter_Bootstrap3_Form_Inline`.

```

        Email

        Password

                Remember me

```

To use inlineforms with labels you can use the class `Twitter_Bootstrap3_Form_Inlinelabel`.

If you are using inline forms, the dimensions will not be set of course. If you need dimensions, you can add them using the attribute formgroupclass like this:

```
		$count = new Twitter_Bootstrap3_Form_Element_Number('count');
		$count->setAttrib('formgroupclass','col-xs-6');
```

This will give you the following output:

```

```

You can also use bootstrap addons on inputs. Something like this:

```
		$message = new Zend_Form_Element_Textarea('message');
		$message->setAttrib('addon_append','@');
```

will generate the following input group:

```

	@

```

Supported controls
------------------

[](#supported-controls)

The library supports all Zend Framework 1 and Bootstrap 3 form elementes.

All example present for vertical form.

### Inputs

[](#inputs)

Most common form control, text-based input fields. Includes support for all HTML5 types: `text`, `password`, `datetime`, `datetime-local`, `date`, `month`, `time`, `week`, `number`, `email`, `url`, `search`, `tel`, and `color`.

```

    Text

```

```
$this->addElement('text', 'text', array(
    'label' => 'Text',
    'placeholder' => 'Text input',
));
```

### Textarea

[](#textarea)

```

    Textarea
    Textarea

```

```
$this->addElement('textarea', 'textarea', array(
    'label' => 'Textarea',
    'value' => 'Textarea',
    'rows' => 4,
));
```

### Checkboxes and radios

[](#checkboxes-and-radios)

#### One checkbox

[](#one-checkbox)

```

            Checkbox

```

```
$this->addElement('checkbox', 'checkbox', array(
    'label' => 'Checkbox',
    'checkedValue' => 'checked Value',
    'uncheckedValue' => 'unchecked Value',
));
```

#### One checkbox without hidden field (might come in handy if jquery or others are being used on name)

[](#one-checkbox-without-hidden-field-might-come-in-handy-if-jquery-or-others-are-being-used-on-name)

```

            Checkbox

```

```
$this->addElement('checkbox', 'checkbox', array(
    'label' => 'Checkbox',
    'checkedValue' => 'checked Value',
    'uncheckedValue' => 'unchecked Value',
));
$checkbox->setAttrib('disableHidden', true);
```

#### MultiCheckbox

[](#multicheckbox)

```

            Option one is this and that — be sure to include why it's great

            Option two is disabled

```

```
$this->addElement('multiCheckbox', 'multiCheckbox', array(
    'multiOptions' => array(
        'option1' => 'Option one is this and that &mdash; be sure to include why it\'s great',
        'option2' => 'Option two is disabled',
    ),
    'disable' => array('option2'),
    'escape' => false,
));
```

#### Radios

[](#radios)

```

    Radio

            Option one is this and that — be sure to include why it's great

            Option two can be something else and selecting it will deselect option one

            Option three is disabled

```

```
$this->addElement('radio', 'radio', array(
    'multiOptions' => array(
        'option1' => 'Option one is this and that &mdash; be sure to include why it\'s great',
        'option2' => 'Option two can be something else and selecting it will deselect option one',
        'option3' => 'Option three is disabled',
    ),
    'label' => 'Radio',
    'value' => 'option1',
    'disable' => array('option3'),
    'escape' => false,
));
```

#### Inline multicheckbox and radio

[](#inline-multicheckbox-and-radio)

```

        One

        Two

        One

        Two

```

```
$this->addElement('multiCheckbox', 'checkbox', array(
    'multiOptions' => array(
        '1' => 'One',
        '2' => 'Two',
    ),
    'inline' => true,
));

$this->addElement('radio', 'radio', array(
    'multiOptions' => array(
        '1' => 'One',
        '2' => 'Two',
    ),
    'inline' => true,
));
```

### Selects

[](#selects)

#### One value

[](#one-value)

```

    Select

        one
        two
        three

```

```
$this->addElement('select', 'select', array(
    'label' => 'Select',
    'multiOptions' => array(
        1 => 'one',
        2 => 'two',
        3 => 'three',
    ),
));
```

#### Multiple

[](#multiple)

```

    MultiSelect

        January
        February
        March
        April
        May
        June
        July
        August
        September
        October
        November
        December

```

```
$this->addElement('multiselect', 'multiselect', array(
    'label' => 'MultiSelect',
    'multiOptions' => array(
        1 => 'January',
        2 => 'February',
        3 => 'March',
        4 => 'April',
        5 => 'May',
        6 => 'June',
        7 => 'July',
        8 => 'August',
        9 => 'September',
        10 => 'October',
        11 => 'November',
        12 => 'December',
    ),
));
```

### Buttons

[](#buttons)

Includes support for button types: `button`, `submit`, `reset` and `image`.

```

    button

```

```
$this->addElement('button', 'button', array(
    'label' => 'button',
));

$this->addElement('submit', 'submit', array(
    'label' => 'submit',
));

$this->addElement('reset', 'reset', array(
    'label' => 'reset',
));

$this->addElement('image', 'image', array(
    'src' => '/button.png',
));
```

### Simple text

[](#simple-text)

Element `static` is an alias of element `note`.

```

    Static
    Static

```

```
$this->addElement('static', 'static', array(
    'label' => 'Static',
    'value' => 'Static',
));
```

### Other decorated elements

[](#other-decorated-elements)

The library also contains elements for decorators: `file`, `hidden`, `hash` and `captcha`.

This does also contain HTML5 Input Types like the range element. Usage like this:

```
$distanceinput = new Twitter_Bootstrap3_Form_Element_Range('distanceinput');
$distanceinput->setAttrib('min','5')->setAttrib('max','50')->setAttrib('step','5');
$distanceinput->setLabel('Distance in kilometers');
$distanceinput->setDescription('Set the distance in kilometers here');
```

The other HTML5 Input Types are tel, url, date, time, datetime and datetimelocal.

If you need to use HTML unescaped in labels or descriptions you can use this snippet:

```
$distanceinput->getDecorator('description')->setOption('escape', false);
```

If you like using addons, use code like this:

```
$field = new Twitter_Bootstrap3_Form_Element_DateTimeLocal('field');
$field->setAttrib('addon_append','');
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~172 days

Recently: every ~311 days

Total

11

Last Release

2320d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2771909?v=4)[Lennart Fries](/maintainers/Cruiser13)[@Cruiser13](https://github.com/Cruiser13)

---

Top Contributors

[![Cruiser13](https://avatars.githubusercontent.com/u/2771909?v=4)](https://github.com/Cruiser13 "Cruiser13 (30 commits)")[![IlyaSerdyuk](https://avatars.githubusercontent.com/u/3463730?v=4)](https://github.com/IlyaSerdyuk "IlyaSerdyuk (17 commits)")[![wendrowycz](https://avatars.githubusercontent.com/u/921527?v=4)](https://github.com/wendrowycz "wendrowycz (15 commits)")

---

Tags

formzendzendtwitterbootstrapformtwitter bootstrapzend-formZF1zend form decoratorszend form elements

### Embed Badge

![Health badge](/badges/cruiser13-zend1-bootstrap3/health.svg)

```
[![Health](https://phpackages.com/badges/cruiser13-zend1-bootstrap3/health.svg)](https://phpackages.com/packages/cruiser13-zend1-bootstrap3)
```

###  Alternatives

[zfbase/zend1-bootstrap3

Twitter Bootstrap v.3 Forms for Zend Framework v.1

1458.0k3](/packages/zfbase-zend1-bootstrap3)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7032.9M33](/packages/mopa-bootstrap-bundle)[tomaj/nette-bootstrap-form

Nette bootstrap form renderer

28450.6k8](/packages/tomaj-nette-bootstrap-form)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

232.7k](/packages/cornford-bootstrapper)[namesco/ztal

ZTal makes integrating the PHP templating system PHPTAL into Zend Framework easy.

2119.9k](/packages/namesco-ztal)[ycs77/laravel-form-builder-bs4

The laravel-form-builder's bootstrap 4 template.

1342.9k2](/packages/ycs77-laravel-form-builder-bs4)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
