<?php
    
    namespace frontend\helpers;
    
    
    class Url extends \artbox\core\helpers\Url
    {
        /**
         * @param bool   $scheme
         * @param string $languagesClass
         *
         * @return string
         * @throws \yii\base\InvalidConfigException
         * @throws \yii\di\NotInstantiableException
         */
        public static function home($scheme = false, $languagesClass = 'artbox\core\services\Languages')
        {
            /**
             * @var \artbox\core\services\Languages $languages
             * @var \artbox\core\seo\UrlManager     $urlManager
             */
            $languages = \Yii::$container->get($languagesClass);
            
            $url = '/' . $languages->getCurrent()->url;
            
            $urlManager = \Yii::$app->urlManager;
            
            if (( $languages->getCurrent()->id === $languages->getDefault(
                    )->id ) && $urlManager->hideDefaultLanguagePrefix) {
                $url = '/';
            }
            
            if ($scheme !== false) {
                $url = $urlManager->getHostInfo() . $url;
            }
            
            return $url;
        }
    }