baseline
This commit is contained in:
28
lib/Support/Tile.php
Normal file
28
lib/Support/Tile.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Support;
|
||||
|
||||
class Tile
|
||||
{
|
||||
public static function render(array $options = []): void
|
||||
{
|
||||
$defaults = [
|
||||
'href' => '#',
|
||||
'label' => '',
|
||||
'count' => null,
|
||||
'icon' => 'bi bi-grid-1x2',
|
||||
'iconBg' => null,
|
||||
'iconColor' => null,
|
||||
'class' => '',
|
||||
];
|
||||
|
||||
$data = array_merge($defaults, $options);
|
||||
$template = dirname(__DIR__, 2) . '/templates/partials/app-tile.phtml';
|
||||
if (!is_file($template)) {
|
||||
return;
|
||||
}
|
||||
|
||||
extract($data, EXTR_SKIP);
|
||||
require $template;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user