Git Product home page Git Product logo

cakephp-bootstrap3-helpers's People

Contributors

ajfranzoia avatar codaxis avatar horgen avatar klarkc avatar sww13 avatar thegallagher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cakephp-bootstrap3-helpers's Issues

Adding custom class to checkboxes

Hi

I'm running a toggle script that requires a .toggle-* class on the checkbox. Your current code dosnt allow me to add any class.

Suggested fix:
#13

This will still remove .form-control but make it possible to add your own class to each checkbox.

Your README.md

Hey,
first of all, your plugin is great thumbs up.

You have a mistake in your README file. In point 3 of Installation. The invoking must be without the trailing Helper like as follows:

// In AppController.php
#public $helpers = array('Bs3Helpers.Bs3FormHelper'); //FALSE
public $helpers = array('Bs3Helpers.Bs3Form'); //Correct
// or
#public $helpers = array('Form' => array('className' => 'Bs3Helpers.Bs3FormHelper')); //FALSE 
public $helpers = array('Form' => array('className' => 'Bs3Helpers.Bs3Form')); //Correct

Have a nice day,
Alex

Plugin Bs3Helpers could not be found

I was copy 2 file Bs3FormHelper and Bs3HtmlHelper to View/Helper directory. And then, a made a form and run. But result to me this error

Plugin Bs3Helpers could not be found

Please, Help

FormHelper radio inputs creating corrupt HTML code

First of all thanks a lot for this great helper! Exactly what I was looking for!

I have an issue with the radio input. Taking your example out of your documentation:

    echo $this->Form->input('test6', array(
        'label' => false,
        'type' => 'radio',
        'inline' => false,
        'options' => array(
            1 => 'Option one',
            2 => 'Option two',
        ),
        'default' => 1,
    ));

generates this HTML:

<div class="form-group">
<input id="test13_" type="hidden" value="" name="data[test13]">
<label id="1" type="domIdSuffix" data[1]"="" for="test13<input name=">
" class="radio-inline">
<input id="test13<input name=" type="radio" data[1]"="" name="data[test13]">
" errorClass="has-error" showError="1" value="1" /> 1
</label>
<label id="2" type="domIdSuffix" data[2]"="" for="test13<input name=">
" class="radio-inline">
<input id="test13<input name=" type="radio" data[2]"="" name="data[test13]">
" errorClass="has-error" showError="1" value="2" /> 2
</label>
<label id="3" type="domIdSuffix" data[3]"="" for="test13<input name=">
" class="radio-inline">
<input id="test13<input name=" type="radio" data[3]"="" name="data[test13]">
" errorClass="has-error" showError="1" value="3" /> 3
</label>
</div>

Which looks on screen like this:

2014-04-24_13-18-02

Any idea what could be the issue?
All the other inputs are working fine.

I tested with the V1.0 download from your website and as well with latest code from GitHub. Same result.

Array to string convertion notice in _formatAttribute due to badly structured 'error' attribute in Bs3FormHelper class

I was trying to overwrite Bs3FormHelper class to add dateTime() method to be automatically used for date&time fields (just because I love to bake my views instead of monotonously adjust them by hand).

As a startup I created a simple helper class like this:

App::uses('Bs3FormHelper', 'Bs3Helpers.View/Helper');

class DateTimePickerHelper extends Bs3FormHelper {

    public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $attributes = array()) {

        $options = $this->_initInputOptions($attributes);
        return $this->text($fieldName, $options);
    }

}

The above code however created a notice:

Notice (8): Array to string conversion [CORE\Cake\View\Helper.php, line 490]

After some debugging I found the notice is thrown while formatting 'error' attribute which is declared in $_myInputDefaults array somewhere around line 35. I think it should simply read:

protected $_myInputDefaults = array(
        ...
        'error' => array(
            'class' => 'help-block'
        ),
        ...
    );

I modified $attributes with this statement:

if(array_key_exists('error', $options) && is_array($options['error']) && array_key_exists('attributes', $options['error']))
            $options['error'] = $options['error']['attributes'];

and it worked but I think the declaration should be changed in your helper to avoid future issues.

Thanks,

Arthur

PS.
I was using CakePHP 2.5.6 here.

PPS.
I love your helpers. Good work!

Your website bs3form.codaxis.com

Dear Augusto,

I noted that the blog on your website (bs3form.codaxis.com) is meanwhile pointing to the GitHub page. We used to have the professional and very detailed instructions there in style of the Bootstrap pages. Aren't those pages maintained anymore?

Thanks a lot for your reply!
Kind regards
Marco

Radio button legends and fieldsets

First of all, great work with this!

I'm using CakePHP 2.5.1 and I have installed the latest head of the Bs3Helpers plugin from GitHub. Everything is working fine so far, but I can't get radio button legends and fieldsets to work.

From your documentation:

"Create checkbox inputs by setting type => checkbox. Radio groups are created by setting type => radio. Base FormHelper->radio() is overriden, and radio groups are generated without legends or wrapping fieldsets by default."

I'm unclear as to whether this means that they're overridden by default but can be enabled. Or, are they overridden and it is not possible to enable them?

I've tried adding 'legend' => 'This is a legend' which works when the plugin is turned off, but not when it is on.

Again, great work. I find this plugin very useful!

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.