1
多个复选框,我想在我的D7-表单中添加一些复选框。出于某种原因,下面的代码片段不起作用。任何想法为什么或任何建议如何正确地做到这一点?添加在Drupal的形式
$options = array('A', 'B', 'C');
foreach ($themas as $thema) {
// Initialize array
$ra = array();
// Fill up the array with different keys
$key = $prefix.'_thema_'.$thema->tid.'_fiche';
$ra[$key]['#type'] = 'checkboxes';
$ra[$key]['#name'] = $prefix.'_thema_'.$thema->tid.'_opties';
$ra[$key]['#options'] = $options;
}
这的确是一个问题,初始化!每次都会覆盖'#options'的值。谢谢 – Michiel 2011-12-22 15:18:31