16 lines
294 B
PHP
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';
|
|
}
|
|
}
|
|
}
|