Skip to content
Snippets Groups Projects
Unverified Commit c05dd9be authored by Thomas Flori's avatar Thomas Flori
Browse files

add varDump helper and fix example

parent 7bcb4da4
No related branches found
No related tags found
No related merge requests found
......@@ -45,4 +45,8 @@ $templates->addSharedData([
],
]);
echo $templates->render('index', [], 'fullPage');
try {
echo $templates->render('index', [], 'fullPage');
} catch (Throwable $exception) {
echo $exception;
}
......@@ -56,6 +56,7 @@
<div class="col s12 l10" id="right-col">
<?= $v->section('content') ?>
<?= $v->varDump($menu) ?>
</div>
</div>
......
File moved
File moved
<?php
namespace Syna\ViewHelper;
class VarDump extends AbstractViewHelper
{
public function __invoke($var = null, $highlight = true)
{
$definition = var_export($var, true);
if ($highlight) {
$highlighted = highlight_string('<?php ' . $definition, true);
$definition = str_replace('&lt;?php&nbsp;', '', $highlighted);
}
return '<pre>' . $definition . '</pre>';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment