Skip to content

Commit

Permalink
[FoundationBundle] fixed bundles with sub-namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jul 6, 2010
1 parent 8d067ba commit b6799d0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function render($controller, array $options = array())
public function findController($controller)
{
list($bundle, $controller, $action) = explode(':', $controller);
$bundle = strtr($bundle, array('/' => '\\'));
$class = null;
$logs = array();
foreach (array_keys($this->container->getParameter('kernel.bundle_dirs')) as $namespace) {
Expand All @@ -132,7 +133,7 @@ public function findController($controller)
$logs[] = sprintf('Failed finding controller "%s:%s" from namespace "%s" (%s)', $bundle, $controller, $namespace, $try);
}
} else {
if (!in_array($namespace.'\\'.$bundle.'\\'.$bundle, array_map(function ($bundle) { return get_class($bundle); }, $this->container->getKernelService()->getBundles()))) {
if (!in_array($namespace.'\\'.$bundle.'\\'.strtr($bundle, array('\\' => '')), array_map(function ($bundle) { return get_class($bundle); }, $this->container->getKernelService()->getBundles()))) {
throw new \LogicException(sprintf('To use the "%s" controller, you first need to enable the Bundle "%s" in your Kernel class.', $try, $namespace.'\\'.$bundle));
}

Expand Down

0 comments on commit b6799d0

Please sign in to comment.