ajfranzoia / cakephp-bootstrap3-helpers Goto Github PK
View Code? Open in Web Editor NEWYet another Cake 2.x form helper, but with minimal coding and highly configurable.
License: MIT License
Yet another Cake 2.x form helper, but with minimal coding and highly configurable.
License: MIT License
cakephp will close the form with -tag and omit the submit button if you don't pass any arguments to the end() function of the formhelper.
echo $this->Form->end();
this is allows to create the submit button manually. however this behavoir get's broken in BsFormHelper.php:221.
I recommend to add !is_null($options).
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.
Creo que se tendra que un HtmlHelper para este caso.
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
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
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:
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.
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!
I need Bootstarp3-helper (form and html) for CakePHP 3.
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
Ooops,
the download button onto your website pointing to an older version of your plugin. Better use this link https://github.com/Codaxis/cakephp-bootstrap3-helpers/archive/master.zip.
Nice day again,
Alex
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.