16 lines
No EOL
321 B
PHP
16 lines
No EOL
321 B
PHP
<?php
|
|
|
|
namespace App\Utils;
|
|
|
|
class Selected {
|
|
|
|
static function selected($var, $ref) {
|
|
$testPostsPage = explode('/', $ref);
|
|
if (isset($testPostsPage[1]) && $testPostsPage[1] === 'post') {
|
|
$ref = '/posts';
|
|
}
|
|
if ($var === $ref) {
|
|
return 'active';
|
|
}
|
|
}
|
|
} |