function Drupali18nTestCase::formatTable in Internationalization 6
Same name and namespace in other branches
- 7 i18n.test \Drupali18nTestCase::formatTable()
Format object as table, recursive
1 call to Drupali18nTestCase::formatTable()
- Drupali18nTestCase::printObject in tests/
drupal_i18n_test_case.php - Debug dump object with some formatting
File
- tests/
drupal_i18n_test_case.php, line 279
Class
- Drupali18nTestCase
- Test case for typical Drupal tests.
Code
function formatTable($object) {
foreach ($object as $key => $value) {
$rows[] = array(
$key,
is_array($value) || is_object($value) ? $this
->formatTable($value) : $value,
);
}
if (!empty($rows)) {
return theme('table', array(), $rows);
}
else {
return 'No properties';
}
}