OWeb/manage/Controller.php
public function loadController($name)
    {

        if ($this->controller != null) {
            throw new \OWeb\manage\exceptions\Controller("A Controller was already loaded");
        } else {

            try {
                $controller       = new $name(true);
                $this->controller = $controller;
                if (!($controller instanceof \OWeb\types\Controller))
                    throw new \OWeb\manage\exceptions\Controller("A Controller needs to be an instance of \\OWeb\\Types\\Controller");

                \OWeb\manage\Events::getInstance()->sendEvent('loaded@OWeb\manage\Controller', $this->controller);

            } catch (\Exception $ex) {
                throw new \OWeb\manage\exceptions\Controller("The Controller couldn't be loaded due to Errors", 0, $ex);
            }
        }

        return $this->controller;
    }
public function loadController($name)
    {

        if ($this->controller != null) {
            throw new \OWeb\manage\exceptions\Controller("A Controller was already loaded");
        } else {

            try {
                $controller       = new $name(true);
                $this->controller = $controller;
                if (!($controller instanceof \OWeb\types\Controller))
                    throw new \OWeb\manage\exceptions\Controller("A Controller needs to be an instance of \\OWeb\\Types\\Controller");

                \OWeb\manage\Events::getInstance()->sendEvent('loaded@OWeb\manage\Controller', $this->controller);

            } catch (\Exception $ex) {
                throw new \OWeb\manage\exceptions\Controller("The Controller couldn't be loaded due to Errors", 0, $ex);
            }
        }

        return $this->controller;
    }
public function loadController ( $ name ) { if ( $ this -> controller != null ) { throw new \ OWeb \ manage \ exceptions \ Controller ( "A Controller was already loaded" ) ; } else { try { $ controller = new $ name ( true ) ; $ this -> controller = $ controller ; if ( ! ( $ controller instanceof \ OWeb \ types \ Controller ) ) throw new \ OWeb \ manage \ exceptions \ Controller ( "A Controller needs to be an instance of \\OWeb\\Types\\Controller" ) ; \ OWeb \ manage \ Events :: getInstance ( ) -> sendEvent ( 'loaded@OWeb\manage\Controller' , $ this -> controller ) ; } catch ( \ Exception $ ex ) { throw new \ OWeb \ manage \ exceptions \ Controller ( "The Controller couldn't be loaded due to Errors" , 0 , $ ex ) ; } } return $ this -> controller ; }
Will load the Controller as main controller.
Will automaticlly set up the initialisation sequence for the Controller.
The Controller will be initialized once OWeb has finished initialisation.

@param \String $name of the Controller to load.

@return \OWeb\types\Controller Loaded Controller
@throws \OWeb\manage\exceptions\Controller If there is a error to the loading of the COntroller
Will load the Controller as main controller . Will automaticlly set up the initialisation sequence for the Controller . The Controller will be initialized once OWeb has finished initialisation .