Test empty var
This commit is contained in:
parent
6bafa8f0e6
commit
2aa3bce5f7
1 changed files with 2 additions and 2 deletions
|
@ -6,11 +6,11 @@ class Selected {
|
||||||
|
|
||||||
static function selected($var, $ref) {
|
static function selected($var, $ref) {
|
||||||
$testPostsPage = explode('/', $ref);
|
$testPostsPage = explode('/', $ref);
|
||||||
if ($testPostsPage[1] === 'post') {
|
if (isset($testPostsPage[1]) && $testPostsPage[1] === 'post') {
|
||||||
$ref = '/posts';
|
$ref = '/posts';
|
||||||
}
|
}
|
||||||
if ($var === $ref) {
|
if ($var === $ref) {
|
||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue