how can i use bootstrap-UI to set select & radio box values

163 Views Asked by At

hello i'm a biginner in cakephp3 and i wanna use bootstrap-UI to set my select and radio box values like cakephp formhelper.

<?= $this->Form->select(
                        'field',
                        ['Low (7%)', 'middle(15%)', 'Quality (25%)', 'High (30%)'],['label'=>'Error Correction','class'=>'form-control']

                    ); ?>
                    <br/>


                    <?= $this->Form->radio(
                        'Image Format',
                        [
                            ['value' => 'png', 'text' => 'png', 'class'=>'radio-inline'],
                            ['value' => 'gif', 'text' => 'gif'],
                            ['value' => 'jpeg', 'text' => 'jpeg'],
                            ['value' => 'svg', 'text' => 'svg'],
                            ['value' => 'eps', 'text' => 'eps'],

                        ], ['checked' => 'true','label'=>'Image Format','class'=>'radio-inline']
                    ); ?>

Can anyone help me and thanks in advance

1

There are 1 best solutions below

0
On

the above exemple is working but i can't add options because i use bootstrap-ui so i have to use control instead of select or radio like this:

<?= $this->Form->control('ecc', ['type' => 'select', 'label' => 'Error Correction', 'class' => 'form-control'
                        , 'options' => [['value' => 'Low (7%)', 'text' => 'Low (7%)'], ['value' => 'middle(15%)', 'text' => 'middle(15%)'], ['value' => 'Quality (25%)', 'text' => 'Quality (25%)'], ['value' => 'High (30%)', 'text' => 'High (30%)']]]); ?>


                    <br/>

                        <?= $this->Form->control(
                            'Format', ['type' => 'radio', 'checked' => 'true', 'label' => 'Image Format', 'class' => 'radio-inline',
                                'options' => [
                                    ['value' => 'png', 'text' => 'png'],
                                    ['value' => 'gif', 'text' => 'gif'],
                                    ['value' => 'jpeg', 'text' => 'jpeg'],
                                    ['value' => 'svg', 'text' => 'svg'],
                                    ['value' => 'eps', 'text' => 'eps'],

                                ]]
                        ); ?>