Skip to content

Commit

Permalink
Allow multi-dimensional arrays in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
victorstanciu committed Oct 6, 2018
1 parent f6ef8e4 commit f9283d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Resources/views/partials/context/table.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<?php
/**
* @var \League\Plates\Template\Template $this
* @var TemplateHelper $templateHelper
* @var array $data
*/

use SlashTrace\Template\TemplateHelper;

?>
<?php if (count($data)): ?>
<table>
<tbody>
<?php foreach ($data as $key => $value): ?>
<tr>
<td><?= $this->escape($key); ?></td>
<td class="code"><?= $this->escape($value); ?></td>
<td class="code"><?= is_array($value) ? $templateHelper->dump($value) : $this->escape($value); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
3 changes: 2 additions & 1 deletion tests/Fixtures/EventProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ private function createServerData()
'HTTP_HOST' => 'example.com',
'HTTP_AUTHORIZATION' => '',
'FCGI_ROLE' => 'RESPONDER',
'PHP_SELF' => '/var/www/lorem/ipsum/index.php'
'PHP_SELF' => '/var/www/lorem/ipsum/index.php',
'argv' => ['foo', 'bar']
];
}

Expand Down

0 comments on commit f9283d1

Please sign in to comment.