neilime / zf2-twb-bundle

Zend Framework module for easy integration of Twitter Bootstrap
http://neilime.github.io/zf2-twb-bundle/
MIT License
143 stars 94 forks source link

Add support for Bootstrap has-feedback #170

Closed Saeven closed 7 years ago

Saeven commented 8 years ago

Using Bootstrap, one can very simply put glyph icons or font awesome icons into text fields like so:

<div class="form-group has-feedback">
    <label class="control-label">Username</label>
    <input type="text" class="form-control" placeholder="Username" />
    <i class="glyphicon glyphicon-user form-control-feedback"></i>
</div>

I don't think that this was possible to render with the current build.

This PR addresses this, so that you can easily create the structure above by simply adding this to your element config:

    $this->add([
            'name' => 'time_start',
            'type' => Text::class,
            'options' => [
                'label' => _( "Eligible From" ),
                'feedback' => 'glyphicon glyphicon-user',
            ],
        ]);

The feedback option, causes the outer wrapper to get the required 'has-feedback' class, and similarly, creates an add on that has the right classes and feedback item.

Thank you very much for considering this PR.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.3%) to 83.275% when pulling 32f2291b520de71d3087904e515519ea82c81f80 on Saeven:master into 14e09716499e589aa0bb860324ca064cadb7caeb on neilime:master.

neilime commented 8 years ago

Please, can you add documentation in the readme file

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-11.2%) to 72.295% when pulling ab972053f76b19ea2bd628cb7c3a2eea8860285e on Saeven:master into 14e09716499e589aa0bb860324ca064cadb7caeb on neilime:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-55.3%) to 28.266% when pulling 12b5d6ddfb0c8d991f9fdaa265bc8d58c4fca902 on Saeven:master into 14e09716499e589aa0bb860324ca064cadb7caeb on neilime:master.