public function load($module, $instance = null)
    {
        if ( ! is_null($instance))
        {
            if ( ! $this->hasModule($module))
            {
                $this->addModule($module);
            }

            return ($this->instances[$module] = $instance);
        }

        if ($this->hasModule($module))
        {
            return ($this->instances[$module] = new $module);
        }

        throw new UnexpectedValueException("Module {$module} does not exist");
    }
public function load($module, $instance = null)
    {
        if ( ! is_null($instance))
        {
            if ( ! $this->hasModule($module))
            {
                $this->addModule($module);
            }

            return ($this->instances[$module] = $instance);
        }

        if ($this->hasModule($module))
        {
            return ($this->instances[$module] = new $module);
        }

        throw new UnexpectedValueException("Module {$module} does not exist");
    }
public function load ( $ module , $ instance = null ) { if ( ! is_null ( $ instance ) ) { if ( ! $ this -> hasModule ( $ module ) ) { $ this -> addModule ( $ module ) ; } return ( $ this -> instances [ $ module ] = $ instance ) ; } if ( $ this -> hasModule ( $ module ) ) { return ( $ this -> instances [ $ module ] = new $ module ) ; } throw new UnexpectedValueException ( "Module {$module} does not exist" ) ; }
Load a module.

@throws UnexpectedValueException
@param string $module
@param mixed|null $instance
@return mixed
Load a module .