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