slywalker / cakephp-plugin-boost_cake

Bootstrap Plugin for CakePHP
http://slywalker.github.io/cakephp-plugin-boost_cake/
277 stars 92 forks source link

No validation error class added to erroneous fields (has-error missing) #50

Closed stantond closed 10 years ago

stantond commented 10 years ago

Hi

I tried using the same form example on the demo page, but still no luck. My form is output like like this when there are validation errors:

<div class="form-group error">
    <label for... class="control-label">Label</label>
    <input ... class="form-control form-error>
    <div class="error-message">Message</div>
</div>

So no bootstrap error classes. BoostCake works fine for me with pagination and flash.

I'm using bootstrap 3.0.3 and cakephp 2.4.4. The form code:

<?php
    echo $this->Form->create('Property', array(
        'action'=>'search',
        'role'=>'form',
        'inputDefaults' => array(
            'div' => 'form-group',
            'label' => array(
                'class' => 'col col-md-3 control-label'
            ),
            'wrapInput' => 'col col-md-9',
            'class' => 'form-control'
        ),
         'class' => 'well form-horizontal'
    ));
?>
<fieldset>
    <div class="row">
        <div class="col-md-3">
            <?php
                echo $this->Form->input('price_min', array());
                echo $this->Form->input('price_max', array());
            ?>
        </div>
    </div>
    <div class="row">
        <?php
            echo $this->Form->submit('Search', array(
                'class'=>'btn btn-success'));
        ?>
    </div>
</fieldset>
<?php echo $this->Form->end(); ?>

Thanks!

stantond commented 10 years ago

Before/after input aren't working either, they're just added as attributes for the input field rather than generating the proper code around the input. I've installed via composer, set up as per the read me, and use BoostCake pagination and flash without issue. Is there something I could have missed when generating forms with BoostCake?

stantond commented 10 years ago

My bad, had this line in the controller, overriding AppController where I'd added the BoostCake helpers:

public $helpers = array('Html', 'Form');

before adding BoostCake, totally forgot about it.