I want to change the select box created with the CakePHP bake command to a check box.

Asked 2 years ago, Updated 2 years ago, 52 views

I created the form using the bake command in cakephp.

I'd like to change the multiple select boxes to check boxes.

When I looked at the source, the following command generated a select box:
How can I change this to a check box?

$this->Form->control('cours._ids', ['options'=>$cours]);

Enter a description of the image here
Thank you for your cooperation.

php cakephp

2022-09-30 19:39

1 Answers

$this->Form->control('cours._ids', ['options'=>$cours, 'multiple'=>'checkbox'));

Create Select Picker Form-CakePHP 3.7 Cookbook https://book.cakephp.org/3.0/ja/views/helpers/form.html#create-select-picker

Select Picker Attributes
Set 'multiple'-true to allow multiple selections in the selection picker. Set 'checkbox' to create multiple check boxes instead.


2022-09-30 19:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.