29 lines
629 B
PHP
29 lines
629 B
PHP
|
|
<?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;
|
||
|
|
}
|
||
|
|
}
|