无法创建表-Drupal 7
我试图在我的一个表单中创建一个表,但出现了一些错误(注意:theme_tableselect()中未定义的偏移量:X),因此我的表的内容是错误的 这是我的代码,如果有人能告诉我我错过了什么:无法创建表-Drupal 7,drupal,Drupal,我试图在我的一个表单中创建一个表,但出现了一些错误(注意:theme_tableselect()中未定义的偏移量:X),因此我的表的内容是错误的 这是我的代码,如果有人能告诉我我错过了什么: <?php $headers = array( t('Nom'), t('Description'), t('Nombre vidéos'), t('Durée'), t('Mode de lecture'), t('Date'), t('Actions'), );
<?php
$headers = array(
t('Nom'),
t('Description'),
t('Nombre vidéos'),
t('Durée'),
t('Mode de lecture'),
t('Date'),
t('Actions'),
);
$form["gestionvideos_array"] = array(
'#type' => 'fieldset',
'#title' => t('Playlists'),
'#description' => t('Something'),
);
foreach( $aPlaylist as $oPlaylist ){
$rows = array(
'Nom' => ucfirst($oPlaylist->sPlaylistName),
'Description' => $oPlaylist->sDescription,
'Nombre vidéos' => $oPlaylist->iTotal,
'Durée' => $oPlaylist->sDuree,
'Mode de lecture' => $oPlaylist->sMode,
'Date' => $oPlaylist->dCreated,
'Actions' => $oPlaylist->sAction,
);
}
$form["gestionvideos_array"]["table"] = array(
'#type' => 'tableselect',
'#header' => $headers,
'#options' => $rows,
);
?>
使用$rows[]=数组(..);我试过了,但是桌子现在空了…哼。。。移除数组中的键并只使用值如何?非常好,它起作用了;)谢谢你,很高兴知道它起作用了!