public function setController($controller)
    {
        if (! ($controller instanceof LibBaseControllerAbstract)) {
            if (is_string($controller) && strpos($controller, '.') === false) {

                // Controlle name is always singular
                if (AnInflector::isPlural($controller)) {
                    $controller = AnInflector::singularize($controller);
                }

                $identifier = clone $this->getIdentifier();
                $identifier->path = array('controller');
                $identifier->name = $controller;
            } else {
                $identifier = $this->getIdentifier($controller);
            }

            $controller = $identifier;
        }

        $this->_controller = $controller;

        return $this;
    }
public function setController($controller)
    {
        if (! ($controller instanceof LibBaseControllerAbstract)) {
            if (is_string($controller) && strpos($controller, '.') === false) {

                // Controlle name is always singular
                if (AnInflector::isPlural($controller)) {
                    $controller = AnInflector::singularize($controller);
                }

                $identifier = clone $this->getIdentifier();
                $identifier->path = array('controller');
                $identifier->name = $controller;
            } else {
                $identifier = $this->getIdentifier($controller);
            }

            $controller = $identifier;
        }

        $this->_controller = $controller;

        return $this;
    }
public function setController ( $ controller ) { if ( ! ( $ controller instanceof LibBaseControllerAbstract ) ) { if ( is_string ( $ controller ) && strpos ( $ controller , '.' ) === false ) { // Controlle name is always singular if ( AnInflector :: isPlural ( $ controller ) ) { $ controller = AnInflector :: singularize ( $ controller ) ; } $ identifier = clone $ this -> getIdentifier ( ) ; $ identifier -> path = array ( 'controller' ) ; $ identifier -> name = $ controller ; } else { $ identifier = $ this -> getIdentifier ( $ controller ) ; } $ controller = $ identifier ; } $ this -> _controller = $ controller ; return $ this ; }
Method to set a controller object attached to the dispatcher.

@param	mixed	An object that implements AnObjectServiceable, AnServiceIdentifier object
or valid identifier string

@throws KDispatcherException If the identifier is not a controller identifier

@return LibBaseDispatcherAbstract
Method to set a controller object attached to the dispatcher .