wiakowe / form-bundle
A bundle which contains helper form types to aid our needs: "choice with disabled options", "jquery minicolors colorpicker".
Installs: 162
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/wiakowe/form-bundle
Requires
- php: >=5.3.2
- symfony/form: 2.1.*
- symfony/framework-bundle: 2.1.*
- symfony/twig-bridge: 2.1.*
This package is not auto-updated.
Last update: 2025-10-25 17:48:47 UTC
README
Set of form types which we have ended up needing.
Choice with disabled options
The type choice_with_disabled_options works exactly like the choice type, except that it adds an additional option,
disabled_choices, which allows you to show some options greyed out.
Example usage:
$formBuilder->add(
    'field',
    'choice_with_disabled_options',
    array(1 => 'First', 2 => 'Second'),
    array(
        'disabled_choices' => array(2)
    )
);
This code will lead, aproximately, to the following HTML:
<select>
    <option value="1">First</option>
    <option value="2" disabled="disabled">Second</option>
</select>
JQuery MiniColors
The JQuery Minicolors type allows adding a color picker to a form. The selected color will be stored as a 6 characters hex
with a prepended #. For instance: #ff00ff.
Example usage:
$formBuilder->add('field', 'jquery_minicolors');
For this plugin to work properly, it requires that the user has loaded the JQuery Minicolors library.
Next steps
- Validate that choice_with_disabled_optionsdoesn't receive a disabled choice.
- Make choice_with_disabled_optionswork with theexpandedtemplate.