CodeIgniter Forums
Profiler fails if model is assigned an alias - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Profiler fails if model is assigned an alias (/thread-20127.html)



Profiler fails if model is assigned an alias - El Forum - 06-29-2009

[eluser]Unknown[/eluser]
Hi There

Not sure if this is a known bug or not but I did do a search and couldn't find anything on it.

I've been using the profiler to optimize my application.

It works absolutely fine unless I assign my model a different name.

for example this works fine:

Code:
class Pages extends Controller {

    function Pages()
    {
        parent::Controller();    
        $this->load->model('Pages_model');
        $this->output->enable_profiler(TRUE);
    }

    function index()
    {
        $data = array(
            'page'=>$this->Pages_model->get_page()
        );
        $this->load->view('pages-view',$data);
    }
}

But this fails (just a blank screen):

Code:
class Pages extends Controller {

    function Pages()
    {
        parent::Controller();    
        $this->load->model('Pages_model', 'pages');
        $this->output->enable_profiler(TRUE);
    }

    function index()
    {
        $data = array(
            'page'=>$this->pages->get_page()
        );
        $this->load->view('pages-view',$data);
    }
}

It definitely seems to be the alias that causes it to fail.
Has anyone else had this experience or is it a know issue?

Cheers


Profiler fails if model is assigned an alias - El Forum - 06-29-2009

[eluser]Dam1an[/eluser]
I've never had this problem, as use the profiler and model aliases all the time
The only differance is I load the profiler in MY_Controller, so it happens before the model, might be worth seeing if that makes a difference...