0

My code is:

    echo $this->Form->control('select', [
     'label' => 'sample label text',
     'type' => 'select',
     'multiple' => true,
     'value' => [1,2],
     'options' => ['a','b']
    ]);

The output is now:

    <label class="control-label" for="select">sample label text</label>
    <input type="hidden" name="select" value="">
    <select name="select[]" multiple="multiple" id="select" class="form-control">
    <option value="0">a</option>
    <option value="1">b</option>
    </select>

How should I change my code to add a span between the label and select?

web_developer
  • 71
  • 1
  • 9
  • 2
    You would need to [customize the templates FormHelper uses](https://book.cakephp.org/3.next/en/views/helpers/form.html#customizing-the-templates-formhelper-uses). – Greg Schmidt Nov 23 '20 at 21:39
  • Learn! Learn! Learn! refer to : https://book.cakephp.org/3.next/en/views/helpers/form.html#using-distinct-custom-form-groups for what you are looking for. You should go through https://stackoverflow.com/help/how-to-ask before asking your next question. – Imdad Dec 31 '20 at 13:17

0 Answers0