Quantcast
Channel: ZF Daily » Form
Viewing all articles
Browse latest Browse all 5

DluTwBootstrap updated to ZF2 RC6

$
0
0

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!

Links


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images