You are here

private static function CleanerSettingsForm::prepareRows in Cleaner 8

Same name and namespace in other branches
  1. 8.2 src/Form/CleanerSettingsForm.php \Drupal\cleaner\Form\CleanerSettingsForm::prepareRows()

Prepare table rows array.

Parameters

array $list: All cache tables form database.

Return value

array Table rows array.

1 call to CleanerSettingsForm::prepareRows()
CleanerSettingsForm::getCacheTablesTable in src/Form/CleanerSettingsForm.php
Get cache tables table.

File

src/Form/CleanerSettingsForm.php, line 107

Class

CleanerSettingsForm
Class CleanerSettingsForm.

Namespace

Drupal\cleaner\Form

Code

private static function prepareRows(array $list) {
  $table_rows = [];
  $cols = 4;
  $count = count($list);
  $rows = ceil($count / $cols);
  $list = array_pad($list, $rows * $cols, ' ');
  for ($i = 0; $i < $count; $i += $cols) {
    $table_rows[] = array_slice($list, $i, $cols);
  }
  return $table_rows;
}