0

I'd like to know if CakePHP3(.1) is supposed to manage multiselect values by itself when we edit an object? I mean, check already selected options and affect modifications like for simple datas. According to my tests (but maybe I didn't initialised it correctly) and Cakephp 3 Unable to mark multiple checkboxes selected, it seems not to be the case.

<?= $this->Form->create($site, ['type' => 'file', 'horizontal' => true])?>
     <?= $this->Form->input('sitecategories', ['options' => $categories, 'label' => __("Catégories :"), 'placeholder' => __("Catégorie du site"), 'multiple' => true]); ?>
....

$site contains an array of sitecategories.

Community
  • 1
  • 1
fralbo
  • 2,534
  • 4
  • 41
  • 73
  • @ndm I'm going to see why it doesn't work for me. – fralbo Nov 01 '15 at 18:11
  • 1
    for CakePHP's magic to work, you have to follow its [Model and database Naming Conventions](http://book.cakephp.org/3.0/en/intro/conventions.html#model-and-database-conventions) when it comes to defining your models and their relationships. – webdevius Nov 01 '15 at 22:43

0 Answers0