MX_Loader::initialize PHP Method

initialize() public method

Initialize the loader variables *
public initialize ( $controller = NULL )
    public function initialize($controller = NULL)
    {
        /* set the module name */
        $this->_module = CI::$APP->router->fetch_module();
        if ($controller instanceof MX_Controller) {
            /* reference to the module controller */
            $this->controller = $controller;
            /* references to ci loader variables */
            foreach (get_class_vars('CI_Loader') as $var => $val) {
                if ($var != '_ci_ob_level') {
                    $this->{$var} =& CI::$APP->load->{$var};
                }
            }
        } else {
            parent::initialize();
            /* autoload module items */
            $this->_autoloader(array());
        }
        /* add this module path to the loader variables */
        $this->_add_module_paths($this->_module);
    }

Usage Example

コード例 #1
0
ファイル: MY_Loader.php プロジェクト: nosesdive/Dashboard
 /**
  * Override Initialize 
  *
  * This method is add utlis config
  *
  * @param 	array
  * @return 	void
  */
 public function initialize($controller = null)
 {
     parent::initialize($controller);
     // config utils path and check autoloading
     $this->_ci_utils_paths = array(APPPATH, BASEPATH);
     $this->_ci_utils_autoloader();
 }
All Usage Examples Of MX_Loader::initialize