0

我想知道当我们编辑一个对象时,CakePHP3(.1) 是否应该自己管理多选值?我的意思是,检查已经选择的选项并影响修改,如简单数据。根据我的测试(但也许我没有正确初始化它)和Cakephp 3 Unable to mark multiple checkboxes selected,似乎并非如此。

<?= $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 包含一系列站点类别。

4

0 回答 0