Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Debug/Toolbar/Collectors/BaseCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ abstract class BaseCollector
*/
protected string $key = '';

/**
* Le fichier de vue à utiliser pour rendre l'onglet du collector
*/
protected string $view = '';

/**
* Obtient le titre du collecteur
*/
Expand All @@ -78,6 +83,18 @@ public function getKey(): string
return str_replace(' ', '-', strtolower($this->key));
}

/**
* Obtient le fichier de vue à utiliser pour rendre l'onglet du collector
*/
public function getView(): string
{
if ($this->view === '') {
$this->view = "_{$this->getKey()}.tpl";
}

return $this->view;
}

/**
* Renvoie toute information devant être affichée à côté du titre.
*/
Expand Down Expand Up @@ -218,6 +235,7 @@ public function getAsArray(): array
'title' => $this->getTitle(),
'titleSafe' => $this->getTitle(true),
'key' => $this->getKey(),
'view' => $this->getView(),
'titleDetails' => $this->getTitleDetails(),
'display' => $this->display(),
'badgeValue' => $this->getBadgeValue(),
Expand Down
2 changes: 1 addition & 1 deletion src/Debug/Toolbar/Views/toolbar.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<div id="blitzphp-<?= $c['key'] ?>" class="tab">
<h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2>

<?= is_string($c['display']) ? $c['display'] : $parser->setData($c['display'])->render("_{$c['key']}.tpl") ?>
<?= is_string($c['display']) ? $c['display'] : $parser->setData($c['display'])->render($c['view']) ?>
</div>
<?php endif ?>
<?php endif ?>
Expand Down