Compare commits

...

2 Commits

2 changed files with 4 additions and 3 deletions

View File

@ -64,7 +64,6 @@ final class MainController extends AbstractController
foreach ($finder as $file) { foreach ($finder as $file) {
$current = &$tree; $current = &$tree;
// Dunno why it is undefined, it works
foreach (explode('/', $file->getRelativePath()) as $part) { foreach (explode('/', $file->getRelativePath()) as $part) {
if ($part === '') break; if ($part === '') break;
@ -74,7 +73,9 @@ final class MainController extends AbstractController
$current = &$current[$part]; $current = &$current[$part];
} }
$current[$file->getFilenameWithoutExtension()] = []; if (!isset($current[$part])) {
$current[$file->getFilenameWithoutExtension()] = [];
}
} }
return $this->render('main/index.html.twig', [ return $this->render('main/index.html.twig', [

View File

@ -11,7 +11,7 @@
}) }}"> }) }}">
{{ name }} {{ name }}
</a> </a>
{{ _self.render_tree(subtree, name ~ '/') }} {{ _self.render_tree(subtree, prefix ~ name ~ '/') }}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>