KT-personal-website/app/Utils/Selected.php
2024-10-22 12:26:08 +02:00

16 lines
294 B
PHP

<?php
namespace App\Utils;
class Selected {
static function selected($var, $ref) {
$testPostsPage = explode('/', $ref);
if ($testPostsPage[1] === 'post') {
$ref = '/posts';
}
if ($var === $ref) {
return 'active';
}
}
}