【发布时间】:2019-08-04 09:23:29
【问题描述】:
foreach ($courses as $user) {
$options[$user['uid']] = [
'coursecode' => $user['coursecode'],
'coursename' => $user['coursename'],
'credithours' => $user['credithours'],
'coursetype' => $user['coursetype'],
'building' => $user['building'],
'place' => $user['place'],
'day' => $user['day'],
'time' => $user['time'],
];
}
$form['table'] = [
'#type' => 'tableselect',
'#header' => $header,
'#options' => $options,
'#empty' => t('No Courses found'),
'#js_select' => false,
'#attributes' => ['checked' => 'checked'],
];
此代码生成我可以注册的所有课程是否有任何方法可以检查特定值作为默认值,我在选中特定复选框时遇到问题
所以有什么帮助吗? 我正在使用 drupal 8
【问题讨论】:
标签: php forms symfony drupal drupal-8