protected function createControllerClass($pClassName)
    {
        if ($pClassName != '') {
            try {
                if ($this->controllerFactory) {
                    $this->controller = call_user_func_array($this->controllerFactory, array(
                        $pClassName,
                        $this
                    ));
                } else {
                    $this->controller = new $pClassName($this);
                }
                if (get_parent_class($this->controller) == '\RestService\Server') {
                    $this->controller->setClient($this->getClient());
                }
            } catch (\Exception $e) {
                throw new \Exception('Error during initialisation of '.$pClassName.': '.$e, 0, $e);
            }
        } else {
            $this->controller = $this;
        }
    }
protected function createControllerClass($pClassName)
    {
        if ($pClassName != '') {
            try {
                if ($this->controllerFactory) {
                    $this->controller = call_user_func_array($this->controllerFactory, array(
                        $pClassName,
                        $this
                    ));
                } else {
                    $this->controller = new $pClassName($this);
                }
                if (get_parent_class($this->controller) == '\RestService\Server') {
                    $this->controller->setClient($this->getClient());
                }
            } catch (\Exception $e) {
                throw new \Exception('Error during initialisation of '.$pClassName.': '.$e, 0, $e);
            }
        } else {
            $this->controller = $this;
        }
    }
protected function createControllerClass ( $ pClassName ) { if ( $ pClassName != '' ) { try { if ( $ this -> controllerFactory ) { $ this -> controller = call_user_func_array ( $ this -> controllerFactory , array ( $ pClassName , $ this ) ) ; } else { $ this -> controller = new $ pClassName ( $ this ) ; } if ( get_parent_class ( $ this -> controller ) == '\RestService\Server' ) { $ this -> controller -> setClient ( $ this -> getClient ( ) ) ; } } catch ( \ Exception $ e ) { throw new \ Exception ( 'Error during initialisation of ' . $ pClassName . ': ' . $ e , 0 , $ e ) ; } } else { $ this -> controller = $ this ; } }
Setup the controller class.

@param  string    $pClassName
@throws \Exception
Setup the controller class .