2024-10-22 12:26:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Utils;
|
|
|
|
|
|
|
|
class Selected {
|
|
|
|
|
|
|
|
static function selected($var, $ref) {
|
|
|
|
$testPostsPage = explode('/', $ref);
|
2024-12-03 16:56:41 +01:00
|
|
|
if (isset($testPostsPage[1]) && $testPostsPage[1] === 'post') {
|
2024-10-22 12:26:08 +02:00
|
|
|
$ref = '/posts';
|
|
|
|
}
|
|
|
|
if ($var === $ref) {
|
|
|
|
return 'active';
|
|
|
|
}
|
|
|
|
}
|
2024-12-03 16:56:41 +01:00
|
|
|
}
|