$this->setObjectDescription("Resolver for local web controllers");
// Create unique ID number
- $this->createUniqueID();
+ $this->generateUniqueId();
// Set prefix to "Web"
$this->setCommandPrefix("Web");
// Still not found?
throw new DefaultControllerException($this, self::EXCEPTION_DEFAUL_CONTROLLER_GONE);
}
- }
-
- // Initiate the controller
- $eval = sprintf("\$controllerInstance = %s::create%s(WebCommandResolver::createWebCommandResolver(\$commandName, \$this->getApplicationInstance()));",
- $class,
- $class
- );
+ } // END - if
- // Run the command
- eval($eval);
+ // Initiate the resolver and controller
+ $resolverInstance = ObjectFactory::createObjectByConfiguredName('web_cmd_resolver', array($commandName, $this->getApplicationInstance()));
+ $controllerInstance = ObjectFactory::createObjectByName($class, array($resolverInstance));
- // Is the instance valid?
- if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) {
- // Something is wrong
- $controllerInstance = null;
- }
+ // Remove resolver
+ unset($resolverInstance);
// Return the result
return $controllerInstance;