gpt4 book ai didi

yii - 需要多选列表框 - 在 yii 中

转载 作者:行者123 更新时间:2023-12-02 00:21:31 24 4
gpt4 key购买 nike

我需要yii中的多选列表框,我有表单区域的代码但它在字段中作为单词“Array”保存到数据库中,如何处理这个问题?

如何在查看和更新​​以及 GridView 时返回

<?php echo $form->dropDownList($model,'clients', 
CHtml::listData(client::model()->findAll(array('order'=>'id')), 'id', 'name'),
array('empty'=>'','multiple'=>'multiple','style'=>'width:400px;','size'=>'10'));
?>

谢谢。

最佳答案

对我来说是这样的:

'multiple'=>true

你的代码必须是这样的:

<?php echo $form->dropDownList($model,'clients', 
CHtml::listData(client::model()->findAll(array('order'=>'id')), 'id', 'name'),
array('empty'=>'','multiple'=>true ,'style'=>'width:400px;','size'=>'10'));
?>

关于yii - 需要多选列表框 - 在 yii 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10740877/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com