#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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Saturngod

Subscribe now to keep reading and get access to the full archive.

Continue reading