Skip to content

Commit

Permalink
PresenterManager fixed creating presenter [Application]
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Dec 8, 2011
1 parent bf8d82d commit 2c33a2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/Kdyby/Application/PresenterManager.php
Expand Up @@ -13,6 +13,7 @@
use Kdyby;
use Kdyby\Package\PackageManager;
use Nette;
use Nette\Reflection\ClassType;
use Nette\Utils\Strings;
use Symfony;
use Symfony\Component\DependencyInjection\Container;
Expand Down Expand Up @@ -63,6 +64,12 @@ public function getPresenterClass(& $name)
return parent::getPresenterClass($name);
}

$serviceName = $this->formatServiceNameFromPresenter($name);
if ($this->container->has($serviceName)) {
$reflection = new ClassType($this->container->getParameter($serviceName . '.class'));
return $reflection->getName();
}

list($package, $shortName) = explode(':', $name, 2);
$package = $this->packageManager->getPackage($package);

Expand All @@ -73,7 +80,7 @@ public function getPresenterClass(& $name)
}


$reflection = new Nette\Reflection\ClassType($class);
$reflection = new ClassType($class);
$class = $reflection->getName();

if (!$reflection->implementsInterface('Nette\Application\IPresenter')) {
Expand Down

0 comments on commit 2c33a2b

Please sign in to comment.