#MEMO Load Model

Abstract class Controller extends Loader {

public $load;

function Controller()
{
	$this->load=$this;
}

abstract function index();

}

So, I can call like this

class IndexController extends Controller {

    function IndexController()
    {
        parent::Controller();
    }

	function index()
	{
		$this->load->model("simple");
		print_r($this->simple);
	}
}

This is my first time setting look like this and I never thinking before

$this->load=$this ;

In the old, I calling like this

$this->load->simple->function();

hmm… How stupid it!!!

Cheer!!!!
Saturngod

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>