Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法创建表-Drupal 7_Drupal - Fatal编程技术网

无法创建表-Drupal 7

无法创建表-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'), );

我试图在我的一个表单中创建一个表,但出现了一些错误(注意: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'),
);

$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[]=数组(..);我试过了,但是桌子现在空了…哼。。。移除数组中的键并只使用值如何?非常好,它起作用了;)谢谢你,很高兴知道它起作用了!