Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 Yii 项目中使用 Chtml 作为我的表单之一。
我已经以这种形式实现了 radioButton ,即
<?php echo CHtml::radioButtonList('asset', 'asset', $listAsset, array('uncheckValue'=>null));?>
我该如何对此进行验证?
我们不想在表格中使用模型名称意味着尝试以下步骤
分配属性值后,您可以将帖子值分配给模型属性
在 MODEL 的规则函数中指定验证后,您可以使用以下步骤。
例子 :
$model->attributes = $_POST['model']; //if you use model name in other fields $model->asset = $_POST['asset'];