【发布时间】:2016-08-28 08:56:33
【问题描述】:
我正在尝试获取多个值以将它们存储在 cakephp 3.x 的数据库中,但我无法获取我选择的所有值。只有一个。
在我看来:
<select name="internalDestinations[ids]" id="internalDestinations-ids" multiple="true" class="...">
<?php
foreach ($users2 as $i): ?>
<option value="<?= $i['email'] ?>"> <?= $i['email'] ?> </option>
<?php endforeach;
?>
</select>
在我的控制器中:
if($this->request->is('post')){
$alarm->internalDestinations=$this->request->data['internalDestinations']['ids'];
$this->log($this->request->data['internalDestinations']);
}
在我的输入中选择多个项目,我只得到一个:
Array
(
[ids] => xxxxxxx@xxxxx.xxx
)
有什么帮助吗? 非常感谢
【问题讨论】:
标签: cakephp-3.0 multiple-select multipleselection