1. 程式人生 > >CI框架原始碼閱讀筆記9 CI的自動載入機制autoload

CI框架原始碼閱讀筆記9 CI的自動載入機制autoload

public function library($library = '', $params = NULL, $object_name = NULL)
{
    if (is_array($library))
    {
        foreach ($library as $class)
        {
            $this->library($class, $params);
        }
 
        return;
    }
 
    if ($library == '' OR isset($this->_base_classes[$library]))
    {
        return FALSE;
    }
 
    if ( ! is_null($params) && ! is_array($params))
    {
        $params = NULL;
    }
 
    $this->_ci_load_class($library, $params, $object_name);
}