Part of the EllisLab Network
   
 
Profiler fails if model is assigned an alias
Posted: 29 June 2009 11:17 AM   [ Ignore ]  
Summer Student
Total Posts:  2
Joined  08-15-2007

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:

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):

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

Profile
 
 
Posted: 29 June 2009 12:58 PM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2690
Joined  05-18-2008

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…

 Signature 

I’m building a Project Management System for my 3rd year Uni project, Sign up to the beta
Track my progress | Post of the day: UI Designs
Get full auto complete support for CodeIgniter in Eclipse

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120418 Total Logged-in Users: 34
Total Topics: 126518 Total Anonymous Users: 6
Total Replies: 665271 Total Guests: 381
Total Posts: 791789    
Members ( View Memberlist )