load model look like CI

<div class="CodeRay">
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

comments powered byDisqus