実際$this->load->model("book_model")、CodeIgniterdoesを呼び出すと、ジョブが実行されます。つまり、CodeIgniter'sLoader classには、引数として渡したモデルをインスタンス化するメソッドがあります。public function model(...)たとえば、book_modelここにあります。
から取得(にありmodel functionます)Loader classsystem/core
if (in_array($name, $this->_ci_models, TRUE))
{
    return;
}
保護された配列をチェックして_ci_models、要求されたモデルがすでにロードされているかどうかを確認し、ロードreturnsされていない場合はロードします。つまり、(モデルメソッドの最後のセグメント)
$CI->$name = new $model(); // here $model is a variable which has the name of the requsted model
$this->_ci_models[] = $name; // stores the instantiated model name in the _ci_models[] array
return; // then returns
したがって、手動でインスタンス化するためにを使用する必要はなくnew、モデル(他のライブラリまたはクラスにも同じことが適用されます)がロードされると、スクリプト内のどこからでもアクセス/使用できます。
シングルトン(シングルトンパターンに関するSOの回答)デザインパターンを使用しているため、使用可能なスーパーグローバルオブジェクト(CodeIgniterの1つのインスタンス)は1つだけCodeIgniterであり、ロードしたものまたはロードするものすべてを伝送します。$CI
モデルをロードしてから、そのモデルのメソッドをbook_model呼び出すにはinitiateBook()
$this->load->model("book_model"); // book_model loaded/instantiated
$this->book_model->initiateBook(); // initiateBook() function has been called