diff --git a/src/Theme.php b/src/Theme.php index c212b59..3f75397 100644 --- a/src/Theme.php +++ b/src/Theme.php @@ -68,12 +68,14 @@ public function getExtended() */ public function getNamespace() { - $namespaces_array = $this->getConfig('autoload.psr-0', false); + if ($namespace = $this->getConfig('autoload.psr-4', false)) { + return key($namespace); + } - if ($namespaces_array === false || empty($namespaces_array)) { - return false; + if ($namespace = $this->getConfig('autoload.psr-0', false)) { + return key($namespace).'\\'; } - return key($namespaces_array); + return false; } } diff --git a/src/View.php b/src/View.php index a91edc3..e2954c1 100644 --- a/src/View.php +++ b/src/View.php @@ -53,7 +53,7 @@ public static function forge(\Foolz\Theme\Builder $builder, $type, $view) // get the View object in case it can be found $theme = $builder->getTheme(); do { - $class = $theme->getNamespace().'\\'.ucfirst($type).'\\'.Util::lowercaseToClassName($view); + $class = $theme->getNamespace().ucfirst($type).'\\'.Util::lowercaseToClassName($view); if (class_exists($class)) { $new = new $class();