HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers42/tandartsmaas.nl/app/Komma/Pages/PageEntity.php
<?php


namespace Komma\Pages;


use Komma\Entities\SmartEntity;

class PageEntity extends SmartEntity
{
    public function isActive($currentPageEntity)
    {
        switch($this->name)
        {
            case 'home':
                    return $this->route == $currentPageEntity->route || $currentPageEntity->route == '';
                break;
            case 'services': 
                    $services = \Config::get('komma.subServicesNavigation');
                    foreach($services as $service)
                    {
                        $serviceEntity = \Lang::get('pages.' . $service);
                        if($serviceEntity['route'] == $currentPageEntity->route) return true;
                    }
                break;
            case 'practice':
                $practiceInfo = \Config::get('komma.subPracticeNavigation');
                foreach($practiceInfo as $info)
                {
                    $practiceEntity = \Lang::get('pages.' . $info);
                    if($practiceEntity['route'] == $currentPageEntity->route) return true;
                }
                break;
            default:
                return $this->route == $currentPageEntity->route;
        }
        return false;
    }

    public function hasSubmenu()
    {
        $hasSubmenu = ['services','practice'];

        return in_array($this->name, $hasSubmenu);
    }

}