src/Mvc/Application.php
public function registerController($controller, $applicationName = 'default')
    {
    	if ( !$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController ) {
	        if (! class_exists($controller)) {
	            throw new ControllerException("No such controller class {controller} found", array(
	                'controller' => $controller
	            ));
	        }
	        $c = new $controller();
	        if (! ($c instanceof AbstractController)) {
	            throw new ControllerException("Controller {controller} is not in application scope", array(
	                'controller' => $controller
	            ));
	        }
    	}
        else {
        	$c = $controller;
        }
        $settings = $c->getControllerSettings();
        $this->controllers[$applicationName][$settings->getControllerSimpleName()] = $settings;
        
        return $this;
    }
public function registerController($controller, $applicationName = 'default')
    {
    	if ( !$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController ) {
	        if (! class_exists($controller)) {
	            throw new ControllerException("No such controller class {controller} found", array(
	                'controller' => $controller
	            ));
	        }
	        $c = new $controller();
	        if (! ($c instanceof AbstractController)) {
	            throw new ControllerException("Controller {controller} is not in application scope", array(
	                'controller' => $controller
	            ));
	        }
    	}
        else {
        	$c = $controller;
        }
        $settings = $c->getControllerSettings();
        $this->controllers[$applicationName][$settings->getControllerSimpleName()] = $settings;
        
        return $this;
    }
public function registerController ( $ controller , $ applicationName = 'default' ) { if ( ! $ controller instanceof \ Nkey \ Caribu \ Mvc \ Controller \ AbstractController ) { if ( ! class_exists ( $ controller ) ) { throw new ControllerException ( "No such controller class {controller} found" , array ( 'controller' => $ controller ) ) ; } $ c = new $ controller ( ) ; if ( ! ( $ c instanceof AbstractController ) ) { throw new ControllerException ( "Controller {controller} is not in application scope" , array ( 'controller' => $ controller ) ) ; } } else { $ c = $ controller ; } $ settings = $ c -> getControllerSettings ( ) ; $ this -> controllers [ $ applicationName ] [ $ settings -> getControllerSimpleName ( ) ] = $ settings ; return $ this ; }
Register a new controller class

@param string $controller
The full qualified name of controller class to register
@param string $applicationName
Optional name of application where controller will be registered in

@return Application Current application instance

@throws ControllerException
Register a new controller class