DluTwBootstrap updated to ZF2 RC6
DluTwBootstrap – the Zend Framework 2 module for generating Twitter Bootstrap UI (forms) has been updated to Zend Framework 2 RC6.
About
DluTwBootstrap is a Zend Framework 2 module consisting primarily of view helpers, which let you easily generate Twitter Bootstrap UI forms from your standard Zend Framework 2 Form objects without getting your hands dirty with Twitter Bootstrap mark-up. Check the on-line demo to see it in action.
Update to Zend Framework 2 RC6
BC breaks
The Select, Radio and MultiCheckbox value options have been moved from attributes into properties (please see Zend Framework 2.0.0rc6 Released for details). The option values for Selects, Radios and MultiCheckboxes should be now defined under value_options key like this:
//Excerpt from an element definition
'options' => array(
'label' => 'Element label',
'value_options' => array(
'opt_value1' => 'Label for Option 1',
'opt_value2' => 'Label for Option 2',
'opt_value3' => 'Label for Option 3',
),
),
New features
The form error messages may be suppressed
The formRowTwb, formFieldsetTwb and formTwb view helpers now accept a boolean parameter $renderErrors. If set to false, the validation error messages for an element (or for the whole fieldset or form) will not be rendered. Note though, that the form element will still be marked as having errors (i.e. red text and outline), only the error messages are not printed. This parameter is optional and defaults to true. (This feature mimicks the ZF2 formRow view helper behaviour.)
The Text input supports prepended and appended icons
The Text input element always supported prepended and appended texts and now you can also prepend / append icons.
![]()
The icons to prepend / append are specified in the $displayOptions array:
//In a view script...
//Display options for an element
$myElemDisplayOptions => array(
'class' => 'input-medium',
'prependIcon' => 'icon-heart',
'appendIcon' => 'icon-glass',
),
//Display the element
echo $this->formRowTwb($form->get('myElem'), $formType, $myElemDisplayOptions);
You can combine prepended / appended text with icons. The icons are always displayed ‘inside’ (i.e. closer to the input element) and texts are displayed ‘outside’ (i.e. further from the input element).
The Password input supports prepended and appended texts and icons
The Password input now supports prepended / appended text as well as icons. The usage is identical to the Text input.
Have you found a bug?
Should you find a bug in DluTwBootstrap or have a feature request, please use the DluTwBootstrap bugtracker to post a new issue. Thanks for your help!
Just a quick note. When updating with composer I get the following error:
[RuntimeException]
Source directory /home/devhost/dev.elmado.de/vendor/dlu/dlutwbootstrap has uncommitted changes.
Deleting the directory /vendor/dlu/dlutwbootstrap solves this issue.
Hmm… strange. Haven’t you made any changes to your local copy of the module?
Actually I did. I added the icon stuff to the password view helper myself.
That’s likely the problem. Actually it’s not recommended to alter the code under the
vendordirectory in any way. If you need to make any changes, you should fork the code on bitbucket and use it as your own module (i.e. put it undermoduledirectory).Hi David,
any news when you find time to work on DluTwBootstrap again? I am still not sure which Twitter Bootstrap module I should favor, since there are a lot around. From the functionality point of view yours seems to be the most sophisticated one.
Anyway, currently it is not possible to install it via Composer since it requires the Zend Framework dev-master#2a398b4e81c31bdfbda917a867896c48d4f62bcf and my project uses 2.0.2.
Thanks, Ralf
Hi Ralf,
I know DluTwBootstrap might seem a bit neglected lately as I have been quite busy since the end of August. I am sorry for that, but there are simply only so many hours in a day… It really makes me sad to see those pending PRs and bug reports but fear not. I will update the module soon (the next weekend? but please do not take my word for it).
I followed your quest for the ‘best’ TB module on the ML and it’s great that you are still considering DluTwBootstrap after evaluating the others!
David