Welcome Guest, Not a member yet? Register   Sign In
Profiler fails if model is assigned an alias
#1

[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
#2

[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...




Theme © iAndrew 2016 - Forum software by © MyBB